| |
- __builtin__.object
-
- Log
class Log(__builtin__.object) |
|
A log helper class.
This class makes it easier to write log entries. It encapsulates
another log object that supports Python standard log interface, and
makes it easier to format the log message be adding the ability to
support multiple arguments.
Example:
import logging
import confd.log
logger = logging.getLogger(__name__)
mylog = confd.log.Log(logger)
count = 3
name = 'foo'
mylog.debug('got ', count, ' values from ', name) |
|
Methods defined here:
- __init__(self, logobject, add_timestamp=False)
- Initialize a Log object.
The argument 'logobject' is mandatory and can be any object which
should support as least one of the standard log methods (info, warning,
error, critical, debug). If 'add_timestamp' is set to True a time stamp
will precede your log message.
- critical(self, *args)
- Log a critical message.
- debug(self, *args)
- Log a debug message.
- error(self, *args)
- Log an error message.
- fatal(self, *args)
- Just calls critical().
- info(self, *args)
- Log an information message.
- warning(self, *args)
- Log a warning message.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |