Package lxml :: Module etree :: Class PyErrorLog
[hide private]
[frames] | no frames]

Class PyErrorLog

   object --+    
            |    
_BaseErrorLog --+
                |
               PyErrorLog

PyErrorLog(self, logger_name=None) A global error log that connects to the Python stdlib logging package.

The constructor accepts an optional logger name.

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.

Instance Methods [hide private]
 
__init__(self, logger_name=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
copy(...)
Dummy method that returns an empty error log.
 
log(...)
 
receive(...)

Inherited from _BaseErrorLog: __repr__

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]
  level_map

Inherited from _BaseErrorLog: last_error

Inherited from object: __class__

Method Details [hide private]

__init__(self, logger_name=None)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

copy(...)

 
Dummy method that returns an empty error log.
Overrides: _BaseErrorLog.copy