On Thursday, June 30, 2011 00:04:36 Jie Zhang wrote: > On Wed, Jun 29, 2011 at 11:41 PM, Mike Frysinger wrote: > > i wonder why we have this at all. we already have urj_log_level_t > > declaring whether something is an error, a warning, or something else. > > why are we manually adding "Error:" and "Warning:" prefixes to the > > logged strings ? why cant urj_log() prefix things appropriately based > > on the level ? > > Imagine set the level to "all", but you still want to see an error > with "Error" prefix instead of "all" prefix.
urj_log(lvl, ...) is the level at which the specified string should be logged. if you're logging an error, then you should be doing urj_log(URJ_LOG_LEVEL_ERROR, ...) when the level is set by the user, that is simply what what messages dont get displayed. it doesnt affect the levels at which messages get called. > >> >> 1. I cannot find a suitable errnum for some error messages in > >> >> ICE-100B cable. I thought adding a new errnum like > >> >> URJ_ERROR_ICE_100B. But does that means we need a number for each > >> >> cable driver? > >> > > >> > we can add a general URJ_ERROR_CABLE if there's something missing. > >> > what exactly is the case you're handling that the current > >> > URJ_ERROR_* dont cover ? > >> > >> For example error when parsing HEX firmware file. Now I use a new one > >> URJ_ERROR_FIRMWARE, which I think is better than the cable one since > >> other cables can also use this. > > > > i think adding a new general level like URJ_ERROR_INVALID_XXX where XXX > > could be INPUT or FILE or DATA or something. then it can be used with > > any command that takes a file for input. > > Then we will need to change all existing BSDL file parsing error to > use this general one. To avoid touch those existing code, I chose > URJ_ERROR_FIRMWARE. they already have a unique BSDL error we can leave them at ;) -mike
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ 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
