On Wed, Jul 6, 2011 at 5:48 PM, Mike Frysinger <[email protected]> wrote:
> On Wednesday, July 06, 2011 01:14:37 Jie Zhang wrote:
>> +void urj_log_error (void);
>> +void urj_log_warning (void);
>
> seems like these would be easy to confuse behavior wise with "urj_log()".  so

I can change them to

void urj_error_log (void);
void urj_warning_log (void);

So they will follow the style: urj_error_set, urj_error_get, urj_error_reset.

> if we tweak the name and merge your older idea, we could have:
>        urj_log_error_describe (level)
> now that the message prefix issue is sorted out in the core, we dont need to
> worry about that anymore.
>
As I said before, there is no meaning to pass levels other than
WARNING or ERROR to urj_log_error_describe. That function describes an
error.

> also, in the comment above the func, note that it implicitly calls
> urj_error_reset().
>
>> +    if (level == URJ_LOG_LEVEL_WARNING || level == URJ_LOG_LEVEL_ERROR)
>> +    {
>> +        r += log_printf (p, "%s: ", urj_log_level_string (level));
>> +        if (urj_log_state.level <= URJ_LOG_LEVEL_DETAIL)
>> +            r += log_printf (p, "%s:%i %s(): ", file, line, func);
>> +    }
>
> i think this part should read:
> if (level == URJ_LOG_LEVEL_WARNING || level == URJ_LOG_LEVEL_ERROR ||
>    urj_log_state.level <= URJ_LOG_LEVEL_DEBUG)
>    r += log_printf (p, "%s: ", urj_log_level_string (level));
> if (urj_log_state.level <= URJ_LOG_LEVEL_DETAIL)
>    r += log_printf (p, "%s:%i %s(): ", file, line, func);
>
Yes, that's your idea in your previous email. I tried that. But I
found always adding a level prefix would make output ugly and unclear
to read. There is little use to indicate the level of a message when
they are not errors or warnings. For the same reason, I chose to only
output source line information for WARNING and ERROR.


Regards,
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

Reply via email to