2012/1/11 Trevor Bentley <trevor.bent...@sherpasolutions.net>:
> Hello,
>
> First of all, thank you for making PyUSB, it works quite well for our
> cross-platform application!
>

You're welcome.

> We recently started implementing logging in our application that depends
> on PyUSB, and ran into the error propagation problem discussed in this
> message:
>
> http://comments.gmane.org/gmane.comp.python.pyusb.user/872
>
> Simply using a named logger instead of the root logger does work, and
> will be fine for our task.
>
> I am just curious to know if there is a reason that PyUSB does not set
> the Logger.propagate field to False for its loggers, or provide that as
> an option?  It seems like that would be a more expected default, since
> PyUSB logs errors for expected cases (certain driver backends not being
> found).
>

To be sincere, I was not aware of this attribute. It sounds much
better than the hack I provided. I have only one question: if I
configure it to False, is the value inherited by the child loggers?

> Alternatively, it would make more sense if individual modules failing to
> load logged to info or debug levels, and an error level was only logged
> if no backends are found.
>

Sounds quite reasonable. Could you open a ticket in Trac? I am quite
busy with other stuff right now and have no idea when I can fix it.

> The best option, I think, would be providing an interface to turn off
> all PyUSB logging propagation so it does not flood the root logger.
>

Well, I don't like the idea the logging mechanism polluting the
interface. Because of that I implemented the logging through
environment variables. Of course if users begin to request that, I can
change my mind.

-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to