DynAIkonTrap.logging#

Provides access to a preset Python logger. To use call get_logger() once at the start of the file with the parameter set to __name__. Doing so ensures the logging output displays which module a log message was generated in.

Example usage:

logger = get_logger(__name__)

logger.error('A dreadful thing is happening')

Functions

get_logger(name)

Creates a logging.Logger instance with messages set to print the path according to name.

set_logger_config([output_file, level])

Sets up the logger configuration, can pass a file path describing where the logger prints to.

get_logger(name: str) Logger#

Creates a logging.Logger instance with messages set to print the path according to name. The function should always be called with __name__

Parameters:

name (str) – file path as given by __name__

Returns:

A Logger instance. Call the standard info, warning, error, etc. functions to generate

Return type:

Logger

set_logger_config(output_file='/dev/stdout', level='DEBUG')#

Sets up the logger configuration, can pass a file path describing where the logger prints to. Default is /dev/stdout.

Parameters:

output_file (str, optional) – Output file path where the logger prints to. Defaults to ‘/dev/stdout’.