PEP 391 (Dictionary-Based Configuration for Logging) Updated

2009-10-28 Thread Vinay Sajip
I've updated PEP 391 (Dictionary-Based Configuration for Logging):

http://www.python.org/dev/peps/pep-0391/

You can see the changes at

http://svn.python.org/view/peps/trunk/pep-0391.txt?r1=75599r2=75918

All feedback gratefully received!

Cheers,

Vinay Sajip

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 391 (Dictionary-Based Configuration for Logging) Updated

2009-10-28 Thread Wolodja Wentland
On Wed, Oct 28, 2009 at 10:27 +, Vinay Sajip wrote:
 I've updated PEP 391 (Dictionary-Based Configuration for Logging):
 http://svn.python.org/view/peps/trunk/pep-0391.txt?r1=75599r2=75918
+1

 All feedback gratefully received!

The PEP does not seem to specify how handler are retrieved by their
name/id. How should this work? Especially given the statement:

The handler name lookup dictionary is for configuration use only
 and will not become part of the public API for the package.

thanks for incorporating these changes.

Wolodja


signature.asc
Description: Digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 391 (Dictionary-Based Configuration for Logging) Updated

2009-10-28 Thread Vinay Sajip
Wolodja Wentland wentland at cl.uni-heidelberg.de writes:

  All feedback gratefully received!
 
 The PEP does not seem to specify how handler are retrieved by their
 name/id. How should this work? Especially given the statement:
 
 The handler name lookup dictionary is for configuration use only
  and will not become part of the public API for the package.
 

What I mean by this is that, if you specify some handlers in the initial
configuration:

handlers:
  console:
# configuration for a handler
  file:
# configuration for a handler
  email:
# configuration for a handler

then internally, there will be a map which has keys console, file and
email pointing to the respective handlers. In a later incremental call,
you can do

handlers:
  console:
level = ...
  file:
level = ...
  email:
level = ...

and the levels will be set on the handlers previously set up with the same
ids.

If you set up handlers programmatically and give them names:

h = logging.StreamHandler()

h.name = console

this will add an entry to the map with key console and a reference to h as
the value.

Regards,

Vinay Sajip

-- 
http://mail.python.org/mailman/listinfo/python-list