Package plugins :: Module helpers :: Class log_calls
[hide private]
[frames] | no frames]

Class log_calls

source code


Decorator class for functions to easily log when they are entered and left.
Instance Methods [hide private]
 
__init__(self, classname='', log=log)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
function
__call__(self, f)
Returns: given function wrapped by log.debug statements
source code

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

Class Variables [hide private]
  filter_out_classes = ['GajimPluginConfig', 'PluginManager', 'G...
List of classes from which no logs should be emited when methods are called, eventhough log_calls decorator is used.
Instance Variables [hide private]
str full_func_name
Full name of function, with class name (as prefix) if given to decorator.
bool log_this_class
Determines whether wrapper of given function should log calls of this function or not.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, classname='', log=log)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • classname (str) - Name of class to prefix function name (if function is a method).
  • log (logging.Logger) - Logger to use when outputing debug information on when function has been entered and when left. By default: plugins.helpers.log is used.
Overrides: object.__init__

__call__(self, f)
(Call operator)

source code 
Parameters:
  • f - function to be wrapped with logging statements
Returns: function
given function wrapped by log.debug statements

Class Variable Details [hide private]

filter_out_classes

List of classes from which no logs should be emited when methods are called, eventhough log_calls decorator is used.
Value:
['GajimPluginConfig', 'PluginManager', 'GajimPluginConfigDialog', 'Plu\
ginsWindow']

Instance Variable Details [hide private]

full_func_name

Full name of function, with class name (as prefix) if given to decorator.

Otherwise, it's only function name retrieved from function object for which decorator was called.

Type:
str

log_this_class

Determines whether wrapper of given function should log calls of this function or not.
Type:
bool