On Thu, Jun 30, 2011 at 1:08 AM, Mike Frysinger <[email protected]> wrote: > On Thu, Jun 30, 2011 at 01:00, Jie Zhang wrote: >> On Thu, Jun 30, 2011 at 12:57 AM, Mike Frysinger wrote: >>> On Thursday, June 30, 2011 00:52:49 Jie Zhang wrote: >>>> If it's true that user should always call urj_error_describe on >>>> URJ_LOG_LEVEL_ERROR or URJ_LOG_LEVEL_WARNING, why adding an assert is >>>> a bad idea? >>> >>> it's a library. libraries are supposed to return errors, not crash. >> >> But if user should always call urj_error_describe on >> URJ_LOG_LEVEL_ERROR or URJ_LOG_LEVEL_WARNING, the assert will never >> fail, so never crash. > > and if they call it with some other value, they should get back an > error code, not abort the whole application > That's why I think using a new type instead of urj_log_level_t will be better. It will accurately tell the library user what kind of values are allowed.
Jie ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ UrJTAG-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/urjtag-development
