On Wed, Jun 29, 2011 at 11:41 PM, Mike Frysinger <[email protected]> wrote: > On Wednesday, June 29, 2011 22:51:36 Jie Zhang wrote: >> On Wed, Jun 29, 2011 at 6:17 PM, Mike Frysinger wrote: >> The problem is what we want here as a parameter is something to tell >> what we describe is a warning or an error. urj_log_level_t is not >> suitable here. I was lazy and tried to avoid introducing a new type >> something like: >> >> typedef enum >> { >> ERROR, >> WARNING, >> } >> urj_error_or_warning_t; >> >> or define urj_error_describe as >> >> const char * >> urj_error_describe (urj_log_level_t level, bool is_error) >> {} >> >> But I'm afraid this is not intuitive when using. >> >> or define two interfaces: >> >> urj_error_describe () and urj_warning_describe () >> >> both will call an internal urj_error_warning_describe (urj_log_level_t >> level, bool is_error) >> >> Which way do you like more? > > 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.
>> >> 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. 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
