On 2012.05.27 09:27, Peter Stuge wrote:
> It would probably be simpler to do the same thing by moving the
> setting of first to before the loglevel check within the logging
> function.

Except there's no guarantee that the logging function will be called 
during init at all to set the origin, especially once toggleable debug 
logging is in.

To do what you advocate we'd have to be careful to:
- always make sure that at least one debug logging message is issued 
from init(). If someone ever decides to remove that blank usbi_dbg("") 
in init() without realizing it had some use, you're screwed
- ensure that even if debug level is not enabled globally, the origin is 
set on the first call. Again, I see too many ways for a contributor to 
not realize that they have to be careful about the timestamp origin when 
editing the logging code.

Your solution relies on code contributors being aware of specific quirks 
to ensure that modifications don't break existing features. I don't 
think that's the right approach.

Regards,

/Pete

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to