On 2 Feb 2010, at 17:52 , Jean-Michel Pichavant wrote:
Masklinn wrote:
Jean-Michel Pichavant wrote:
To add a custom level, I would proceed that way:
logging.ALERT = 45
logging.addLevelName(logging.ALERT, 'ALERT !!')
logging.getLogger().log(logging.ALERT, 'test')
Passing a string to
The reason is that log takes an *int* as first argument that defines the
logging level. You gave a string. So There is definitely a reason for it to be
incorrect.
That's not a reason, that's just what currently happens. I know it doesn't
work, and I know why, I went and checked the
On 3 Feb 2010, at 11:50 , Jean-Michel Pichavant wrote:
The reason is that log takes an *int* as first argument that defines the
logging level. You gave a string. So There is definitely a reason for it to
be incorrect.
That's not a reason, that's just what currently happens. I know
Masklinn wrote:
On 3 Feb 2010, at 11:50 , Jean-Michel Pichavant wrote:
You don't neeed to check the code for that ! It is written in the
documentation. The logging module designer choose to ask for a level, not a
level name, possibly because 2 different levels can have the same name.
On Feb 3, 11:36 am, Masklinn maskl...@masklinn.net wrote:
Well, Xavier,
I would be the first to agree that the existing logging configuration
API is not ideal. There are a number of reasons for the current
ConfigParser schema used (e.g. an old GUI for configuring logging,
which was there before
Masklinn wrote:
When trying to load the following config file, I get an error
``ConfigParser.NoOptionError: No option 'handlers' in section: 'logger_0'`` (in
both Python 2.6.4 and Python 3.1.1 on OSX, obviously ConfigParser is spelled
configparser in 3.1):
[loggers]
keys=root,0
Jean-Michel Pichavant wrote:
To add a custom level, I would proceed that way:
logging.ALERT = 45
logging.addLevelName(logging.ALERT, 'ALERT !!')
logging.getLogger().log(logging.ALERT, 'test')
Passing a string to the log method as you did is incorrect.
I know it's currently incorrect. My point
Masklinn wrote:
Jean-Michel Pichavant wrote:
To add a custom level, I would proceed that way:
logging.ALERT = 45
logging.addLevelName(logging.ALERT, 'ALERT !!')
logging.getLogger().log(logging.ALERT, 'test')
Passing a string to the log method as you did is incorrect.
I know it's
When trying to load the following config file, I get an error
``ConfigParser.NoOptionError: No option 'handlers' in section: 'logger_0'`` (in
both Python 2.6.4 and Python 3.1.1 on OSX, obviously ConfigParser is spelled
configparser in 3.1):
[loggers]
keys=root,0
[handlers]