Package mvpa :: Package base :: Module verbosity :: Class DebugLogger
[hide private]
[frames] | no frames]

Class DebugLogger

source code


Logger for debugging purposes.

Expands SetLogger with ability to print some interesting information (named Metric... XXX) about current process at each debug printout

Instance Methods [hide private]
 
__init__(self, metrics=None, offsetbydepth=True, *args, **kwargs)
Initialize the logger with a set of handlers to use for output
source code
 
registerMetric(self, func)
Register some metric to report
source code
 
__call__(self, setid, msg, *args, **kwargs)
Write msg
source code
 
_setOffsetByDepth(self, b) source code

Inherited from SetLogger: print_registered, register, setActiveFromString

Inherited from SetLogger (private): _setActive, _setPrintsetid

Inherited from Logger: __del__

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

Class Variables [hide private]
  _known_metrics = {'vmem': lambda: parseStatus(field= 'VmSize')...
  offsetbydepth = property(fget= lambda x: x._offsetbydepth, fse...
  metrics = property(fget= lambda x: x.__metrics, fset= register...

Inherited from SetLogger: active, printsetid, registered

Inherited from Logger: handlers, lfprev

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, metrics=None, offsetbydepth=True, *args, **kwargs)
(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__
(inherited documentation)

registerMetric(self, func)

source code 

Register some metric to report

func can be either a function call or a string which should correspond to known metrics

__call__(self, setid, msg, *args, **kwargs)
(Call operator)

source code 

Write msg

It appends a newline since most commonly each call is a separate message

Overrides: Logger.__call__
(inherited documentation)

Class Variable Details [hide private]

_known_metrics

Value:
{'vmem': lambda: parseStatus(field= 'VmSize'), 'pid': lambda: parseSta\
tus(field= 'Pid'), 'asctime': time.asctime, 'tb': TraceBack(), 'tbc': \
TraceBack(collide= True),}

offsetbydepth

Value:
property(fget= lambda x: x._offsetbydepth, fset= _setOffsetByDepth)

metrics

Value:
property(fget= lambda x: x.__metrics, fset= registerMetric)