km3pipe.logger

The logging facility.

Module Contents

Classes

LogIO

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[, filename, stream_loglevel, ...])

Helper function to get a logger

available_loggers()

Return a list of avialable logger names

set_level(log_or_name, level)

Set the log level for given logger and all handlers

get_printer(name[, color, ansi_code, force_color])

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

Attributes

loggers

DEPRECATION

ONCE

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=X, otherwise the message will be printed every time.

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

Read/write logging information.

send(message, level='info')[source]
connect()[source]
km3pipe.logger.get_logger(name, filename=None, stream_loglevel='INFO', file_loglevel='DEBUG')[source]

Helper function to get a logger

km3pipe.logger.available_loggers()[source]

Return a list of avialable logger names

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

Set the log level for given logger and all handlers

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