Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

Making loggerClass an attribute of the logger manager?

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


g.brandl at gmx

Nov 25, 2009, 12:36 AM

Post #1 of 3 (610 views)
Permalink
Making loggerClass an attribute of the logger manager?

Hi,

recently I had a use case where I wanted to use logging in two
completely separate parts of the same process. One of them
needs to create instances a specific Logger subclass, while the
other is fine with the default loggers.

I got around the problem of the unique root node by using two
Managers (and then using Manager.getLogger() instead of
getLogger()), but I can only set the loggerClass globally.

Making the loggerClass configurable per manager would solve the
problem for me, and AFAICS since most applications don't use
different managers anyway, there should not be any detrimental
effects. What do you think?

cheers,
Georg

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


vinay_sajip at yahoo

Nov 25, 2009, 2:32 AM

Post #2 of 3 (552 views)
Permalink
Re: Making loggerClass an attribute of the logger manager? [In reply to]

Georg Brandl <g.brandl <at> gmx.net> writes:

> Making the loggerClass configurable per manager would solve the
> problem for me, and AFAICS since most applications don't use
> different managers anyway, there should not be any detrimental
> effects. What do you think?

Seems reasonable. Apart from the API to set/get, _loggerClass is only used by
the manager when instantiating a new logger.

Regards,

Vinay Sajip

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


g.brandl at gmx

Feb 6, 2010, 2:06 PM

Post #3 of 3 (293 views)
Permalink
Re: Making loggerClass an attribute of the logger manager? [In reply to]

Am 25.11.2009 11:32, schrieb Vinay Sajip:
> Georg Brandl <g.brandl <at> gmx.net> writes:
>
>> Making the loggerClass configurable per manager would solve the
>> problem for me, and AFAICS since most applications don't use
>> different managers anyway, there should not be any detrimental
>> effects. What do you think?
>
> Seems reasonable. Apart from the API to set/get, _loggerClass is only used by
> the manager when instantiating a new logger.

I've created a patch for this, see <http://bugs.python.org/issue7868>. I'd like
to get this into 2.7 before beta1 :)

Georg


--
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.