exopy.app.log.plugin module

Log plugin definition.

class exopy.app.log.plugin.LogPlugin[source]

Bases: enaml.workbench.plugin.Plugin

Plugin managing the application logging.


List of installed handlers.


List of installed filters.


Model which can be used to display the log in the GUI. It is associated to a handler attached to the root logger.


A value which allows objects of a given type or types.

Values will be tested using the PyObject_TypeCheck C API call. This call is equivalent to type(obj) in cls.mro(). It is less flexible but faster than Instance. Use Instance when allowing heterogenous values and Typed when the value type is explicit.

The value of a Typed may be set to None


Display the current instance of the rotating log file.

add_handler(id, handler=None, logger='', mode=None)[source]

Add a handler to the specified logger.

  • id (unicode) – Id of the new handler. This id should be unique.

  • handler (logging.Handler, optional) – Handler to add.

  • logger (unicode, optional) – Name of the logger to which the handler should be added. By default the handler is added to the root logger.

  • mode ({'ui', }, optional) – Conveninence to add a simple logger. If this argument is specified, handler will be ignored and the command will return useful references (the model to which can be connected a ui for the ‘ui’ mode).


refs – List of useful reference, empty if no mode is selected.

Return type



Remove the specified handler.


id (unicode) – Id of the handler to remove.

add_filter(id, filter, handler_id)[source]

Add a filter to the specified handler.

  • id (unicode) – Id of the filter to add.

  • filter (object) – Filter to add to the specified handler (object implemeting a filter method).

  • handler_id (unicode) – Id of the handler to which this filter should be added


Remove the specified filter.


id (unicode) – Id of the filter to remove.

set_formatter(handler_id, formatter)[source]

Set the formatter of the specified handler.

  • handler_id (unicode) – Id of the handler whose formatter shoudl be set.

  • formatter (Formatter) – Formatter for the handler.