cement.core.log
¶
Cement core log module.
-
class
cement.core.log.
CementLogHandler
(*args, **kw)¶ Bases:
cement.core.handler.CementBaseHandler
Base class that all Log Handlers should sub-class from.
-
class
cement.core.log.
ILog
¶ Bases:
cement.core.interface.Interface
This class defines the Log Handler Interface. Classes that implement this handler must provide the methods and attributes defined below.
Implementations do not subclass from interfaces.
Usage:
from cement.core import log class MyLogHandler(object): class Meta: interface = log.ILog label = 'my_log_handler' ...
-
class
IMeta
¶ Bases:
object
Interface meta-data.
-
label
= 'log'¶ The string identifier of the interface.
-
validator
(klass, obj)¶ The interface validator function.
-
-
ILog.
_setup
(app_obj)¶ The _setup function is called during application initialization and must ‘setup’ the handler object making it ready for the framework or the application to make further calls to it.
Parameters: app_obj – The application object.
-
ILog.
debug
(msg)¶ Log to the ‘DEBUG’ facility.
Parameters: msg – The message to log.
-
ILog.
error
(msg)¶ Log to the ‘ERROR’ facility.
Parameters: msg – The message to log.
-
ILog.
fatal
(msg)¶ Log to the ‘FATAL’ facility.
Parameters: msg – The message to log.
-
ILog.
get_level
()¶ Return a string representation of the log level.
-
ILog.
info
(msg)¶ Log to the ‘INFO’ facility.
Parameters: msg – The message to log.
-
ILog.
set_level
()¶ - Set the log level. Must except atleast one of:
['INFO', 'WARNING', 'ERROR', 'DEBUG', or 'FATAL']
.
-
ILog.
warning
(msg)¶ Log to the ‘WARNING’ facility.
Parameters: msg – The message to log.
-
class
-
cement.core.log.
log_validator
(klass, obj)¶ Validates an handler implementation against the ILog interface.