km3pipe.logger

The logging facility.

Module Contents

Classes

LogIO(node, stream, url=’pi2089.physik.uni-erlangen.de’, port=28777) Read/write logging information.

Functions

deprecation(self, message, *args, **kws) Show a deprecation warning.
once(self, message, *args, **kws) Show a message only once, determined by position in source or identifer.
get_logger(name) Helper function to get a logger
available_loggers() Return a list of avialable logger names
set_level(name, level) Set the log level for given logger
get_printer(name, color=None, ansi_code=None, force_color=False) Return a function which prints a message with a coloured name prefix
hash_coloured(text) Return a ANSI coloured text based on its hash
hash_coloured_escapes(text) Return the ANSI hash colour prefix and suffix for a given text
km3pipe.logger.loggers[source]
km3pipe.logger.DEPRECATION = 45[source]
km3pipe.logger.ONCE = 46[source]
km3pipe.logger.deprecation(self, message, *args, **kws)[source]

Show a deprecation warning.

km3pipe.logger.once(self, message, *args, **kws)[source]

Show a message only once, determined by position in source or identifer.

This will not work in IPython or Jupyter notebooks if no identifier is specified, since then the determined position in source contains the execution number of the input (cell), which changes every time. Set a unique identifier, otherwise the message will be printed every time.

km3pipe.logger.deprecation[source]
km3pipe.logger.once[source]
class km3pipe.logger.LogIO(node, stream, url='pi2089.physik.uni-erlangen.de', port=28777)[source]

Bases:object

Read/write logging information.

send(self, message, level='info')[source]
connect(self)[source]
km3pipe.logger.get_logger(name)[source]

Helper function to get a logger

km3pipe.logger.available_loggers()[source]

Return a list of avialable logger names

km3pipe.logger.set_level(name, level)[source]

Set the log level for given logger

km3pipe.logger.get_printer(name, color=None, ansi_code=None, force_color=False)[source]

Return a function which prints a message with a coloured name prefix

km3pipe.logger.hash_coloured(text)[source]

Return a ANSI coloured text based on its hash

km3pipe.logger.hash_coloured_escapes(text)[source]

Return the ANSI hash colour prefix and suffix for a given text