Logging

There is an abstract class that can be subclassed to allow per class or even per instance logging.

class pypet.pypetlogging.HasLogger[source]

Abstract super class that automatically adds a logger to a class.

Potentially there can be one logger per instance.

If no logging name is specified, there will be one logger per class. The logger will be derived from the class name via:

self._logger = logging.getLogger(type(self).__name__)

__getstate__()[source]

Called for pickling.

Removes the logger to allow pickling and returns a copy of __dict__.

__setstate__(statedict)[source]

Called after loading a pickle dump.

Restores __dict__ from statedict and adds a new logger.

__weakref__

list of weak references to the object (if defined)

_set_logger(name=None)[source]

Adds a logger with a given name.

If no name is given, name is constructed as type(self).__name__.