Package mvpa :: Package base :: Module verbosity :: Class Logger

[hide private]
[frames] | no frames]

# Class Logger

source code

Base class to provide logging

Instance Methods | [hide private]

__init__(self, handlers=None) Initialize the logger with a set of handlers to use for output | source code

__del__(self) | source code

_setHandlers(self, handlers) Set list of handlers for the log. | source code

_closeOpenedHandlers(self) Close opened handlers (such as opened logfiles | source code

_getHandlers(self) Return active handlers | source code

__call__(self, msg, lf=True, cr=False, *args, **kwargs) Write msg to each of the handlers. | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]

| handlers = `property(fget= _getHandlers, fset= _setHandlers)`
| lfprev = `property(fget= lambda self: self.__lfprev)`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, handlers=None)
(Constructor)

source code

Initialize the logger with a set of handlers to use for output

Each hanlder must have write() method implemented

Overrides: object.__init__

### _setHandlers(self, handlers)

source code

Set list of handlers for the log.

A handler can be opened files, stdout, stderr, or a string, which will be considered a filename to be opened for writing

### __call__(self, msg, lf=True, cr=False, *args, **kwargs)
(Call operator)

source code

Write msg to each of the handlers.

It can append a newline (lf = Line Feed) or return to the beginning before output and to take care about cleaning previous message if present

it appends a newline (lf = Line Feed) since most commonly each call is a separate message