On Wed, 2008-06-11 at 00:43 +0200, Christian Heimes wrote:
> John Krukoff wrote:
> > Since you probably want access to these from many different places in
> > your code, I find the simplest way is to create a logging module of your
> > own (not called logging, obviously) and instantiate all of you
John Krukoff wrote:
> Since you probably want access to these from many different places in
> your code, I find the simplest way is to create a logging module of your
> own (not called logging, obviously) and instantiate all of your loggers
> in that namespace, then import that one module as needed
Skye a écrit :
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_GENE
Very cool - I'm liking the pythonic way of doing things more and
more.
The logger namespace/singleton idea makes great sense!
I see how the module variables make globals irrelevant, thanks!
Skye
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 9, 5:00 pm, Skye <[EMAIL PROTECTED]> wrote:
> 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:
>
>
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_GENER
On Mon, 2008-06-09 at 15:02 -0700, Skye wrote:
> On Jun 9, 2:35 pm, Matimus <[EMAIL PROTECTED]> wrote:
> > The only time to do that sort of thing (in python) is when interacting
> > with something else that isn't written in Python though. In general,
> > for logging, just use the standard logging
On Jun 9, 2:35 pm, Matimus <[EMAIL PROTECTED]> wrote:
> The only time to do that sort of thing (in python) is when interacting
> with something else that isn't written in Python though. In general,
> for logging, just use the standard logging
> module:http://docs.python.org/lib/module-logging.html
On Jun 10, 4:32 am, Skye <[EMAIL PROTECTED]> wrote:
> OK, sounds good. So if not bitfields, what would be a good Python-y
> way to do it?
The word is "pythonic".
> Flip booleans in a "debug config" dictionary or something?
I'm not really sure, I've been programming with Python (and some other
l
On Jun 9, 2:00 pm, Skye <[EMAIL PROTECTED]> wrote:
> 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:
>
>
OK, sounds good. So if not bitfields, what would be a good Python-y
way to do it?
Flip booleans in a "debug config" dictionary or something?
Skye
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 10, 4:00 am, Skye <[EMAIL PROTECTED]> wrote:
> 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:
>
>
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
#defin
13 matches
Mail list logo