Question by someone coming from C...

Diez B. Roggisch deets at nospam.web.de
Mon Jun 9 18:15:29 EDT 2008


Skye schrieb:
> Writing this app in Python, not sure what the "best practice" would
> be.
> 
> I want a bitfield global logging level that allows me to turn specific
> debugging modules on and off.  If I was doing this in C, I'd just use
> some globals like:
> 
> unsigned int debug_level = 0;
> #define DEBUG_GENERAL 0x0001
> #define DEBUG_CONFIG 0x0002
> #define DEBUG_OPTIONS 0x0004
> etc etc


For debugging - use the module logging. And configure properly.

Diez



More information about the Python-list mailing list