Trees | Indices | Help |
|
---|
|
Logging package for Python. Based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system.
Should work under Python versions >= 1.5.2, except that source line information is not available unless 'sys._getframe()' is.
Copyright (C) 2001-2004 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
Version: 0.4.9.9
Date: 06 February 2006
Author: Vinay Sajip <vinay_sajip@red-dove.com>
|
|||
|
|
|||
LogRecord A LogRecord instance represents an event being logged. |
|||
Formatter Formatter instances are used to convert a LogRecord to text. |
|||
BufferingFormatter A formatter suitable for formatting a number of records. |
|||
Filter Filter instances are used to perform arbitrary filtering of LogRecords. |
|||
Filterer A base class for loggers and handlers which allows them to share common code. |
|||
Handler Handler instances dispatch logging events to specific destinations. |
|||
StreamHandler A handler class which writes logging records, appropriately formatted, to a stream. |
|||
FileHandler A handler class which writes formatted logging records to disk files. |
|||
PlaceHolder PlaceHolder instances are used in the Manager logger hierarchy to take the place of nodes for which no loggers have been defined. |
|||
Manager There is [under normal circumstances] just one Manager instance, which holds the hierarchy of loggers. |
|||
Logger Instances of the Logger class represent a single logging channel. |
|||
RootLogger A root logger is not that different to any other logger, except that it must have a logging level and there is only one instance of it in the hierarchy. |
|||
_loggerClass Instances of the Logger class represent a single logging channel. |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
__status__ =
|
|||
_srcfile =
|
|||
_startTime = 1201646057.66
|
|||
raiseExceptions = 1
|
|||
logThreads = 1
|
|||
logProcesses = 1
|
|||
CRITICAL = 50
|
|||
FATAL = 50
|
|||
ERROR = 40
|
|||
WARNING = 30
|
|||
WARN = 30
|
|||
INFO = 20
|
|||
DEBUG = 10
|
|||
NOTSET = 0
|
|||
_levelNames =
|
|||
_lock = None
|
|||
_defaultFormatter = Formatter()
|
|||
_handlers =
|
|||
_handlerList =
|
|||
root = RootLogger(WARNING)
|
|||
BASIC_FORMAT =
|
Imports: sys, os, types, time, string, cStringIO, traceback, codecs, threading, thread, currentframe, atexit, config, handlers
|
Return the textual representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have associated levels with names using addLevelName then the name you have associated with 'level' is returned. If a numeric value corresponding to one of the defined levels is passed in, the corresponding string representation is returned. Otherwise, the string "Level %s" % level is returned. |
Associate 'levelName' with 'level'. This is used when converting levels to text during message formatting. |
Acquire the module-level lock for serializing access to shared data. This should be released with _releaseLock(). |
Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__() |
Do basic configuration for the logging system. This function does nothing if the root logger already has handlers configured. It is a convenience method intended for use by simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHandler which writes to sys.stderr, set a formatter using the BASIC_FORMAT format string, and add the handler to the root logger. A number of optional keyword arguments may be specified, which can alter the default behaviour. filename Specifies that a FileHandler be created, using the specified filename, rather than a StreamHandler. filemode Specifies the mode to open the file, if filename is specified (if filemode is unspecified, it defaults to 'a'). format Use the specified format string for the handler. datefmt Use the specified date/time format. level Set the root logger level to the specified level. stream Use the specified stream to initialize the StreamHandler. Note that this argument is incompatible with 'filename' - if both are present, 'stream' is ignored. Note that you could specify a stream created using open(filename, mode) rather than passing the filename and mode in. However, it should be remembered that StreamHandler does not close its stream (since it may be using sys.stdout or sys.stderr), whereas FileHandler closes its stream when the handler is closed. |
Return a logger with the specified name, creating it if necessary. If no name is specified, return the root logger. |
Perform any cleanup actions in the logging system (e.g. flushing buffers). Should be called at application exit. |
|
_levelNames
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Tue Jan 29 22:41:03 2008 | http://epydoc.sourceforge.net |