| Home | Trees | Indices | Help |
|
|---|
object --+ | _BaseErrorLog --+ | PyErrorLog
PyErrorLog(self, logger_name=None, logger=None) A global error log that connects to the Python stdlib logging package.
The constructor accepts an optional logger name or a readily instantiated logger instance.
If you want to change the mapping between libxml2's ErrorLevels and Python logging levels, you can modify the level_map dictionary from a subclass.
The default mapping is:
ErrorLevels.WARNING = logging.WARNING ErrorLevels.ERROR = logging.ERROR ErrorLevels.FATAL = logging.CRITICAL
You can also override the method receive() that takes a LogEntry object and calls self.log(log_entry, format_string, arg1, arg2, ...) with appropriate data.
Inherited from _BaseErrorLog :
__repr__
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__,
__str__,
__subclasshook__
Inherited from _BaseErrorLog :
last_error
Inherited from object:
__class__
Called by the .receive() method to log a _LogEntry instance to the Python logging system. This handles the error level mapping.
In the default implementation, the message argument receives a complete log line, and there are no further args. To change the message format, it is best to override the .receive() method instead of this one.
Receive a _LogEntry instance from the logging system. Calls the .log() method with appropriate parameters:
self.log(log_entry, repr(log_entry))
You can override this method to provide your own log output format.
| Home | Trees | Indices | Help |
|
|---|