Instances of the Logger class represent a single logging channel. A
"logging channel" indicates an area of an application. Exactly
how an "area" is defined is up to the application developer.
Since an application can have any number of areas, logging channels are
identified by a unique string. Application areas can be nested (e.g. an
area of "input processing" might include sub-areas "read
CSV files", "read XLS files" and "read Gnumeric
files"). To cater for this natural nesting, channel names are
organized into a namespace hierarchy where levels are separated by
periods, much like the Java or Python package namespace. So in the
instance given above, channel names might be "input" for the
upper level, and "input.csv", "input.xls" and
"input.gnu" for the sub-levels. There is no arbitrary limit to
the depth of nesting.
|
__init__(self,
name,
level=0)
Initialize the logger with a name and an optional level. |
source code
|
|
|
setLevel(self,
level)
Set the logging level of this logger. |
source code
|
|
|
debug(self,
msg,
*args,
**kwargs)
Log 'msg % args' with severity 'DEBUG'. |
source code
|
|
|
info(self,
msg,
*args,
**kwargs)
Log 'msg % args' with severity 'INFO'. |
source code
|
|
|
|
|
warn(self,
msg,
*args,
**kwargs)
Log 'msg % args' with severity 'WARNING'. |
source code
|
|
|
error(self,
msg,
*args,
**kwargs)
Log 'msg % args' with severity 'ERROR'. |
source code
|
|
|
exception(self,
msg,
*args)
Convenience method for logging an ERROR with exception information. |
source code
|
|
|
|
|
fatal(self,
msg,
*args,
**kwargs)
Log 'msg % args' with severity 'CRITICAL'. |
source code
|
|
|
log(self,
level,
msg,
*args,
**kwargs)
Log 'msg % args' with the integer severity 'level'. |
source code
|
|
|
findCaller(self)
Find the stack frame of the caller so that we can note the source
file name and line number. |
source code
|
|
|
makeRecord(self,
name,
level,
fn,
lno,
msg,
args,
exc_info)
A factory method which can be overridden in subclasses to create
specialized LogRecords. |
source code
|
|
|
_log(self,
level,
msg,
args,
exc_info=None)
Low-level logging routine which creates a LogRecord and then calls
all the handlers of this logger to handle the record. |
source code
|
|
|
|
|
addHandler(self,
hdlr)
Add the specified handler to this logger. |
source code
|
|
|
removeHandler(self,
hdlr)
Remove the specified handler from this logger. |
source code
|
|
|
|
|
|
|
isEnabledFor(self,
level)
Is this logger enabled for level 'level'? |
source code
|
|
Inherited from Filterer :
addFilter ,
filter ,
removeFilter
|