pyanno4rt.logging

Logging module.


This module aims to provide methods and classes to configure an instance of the logger.

Overview

Classes

Logger

Logging class.

Classes

class pyanno4rt.logging.Logger(*args)[source]

Logging class.

This class provides methods to configure an instance of the logger, including multiple stream handlers and formatters to print messages at different levels.

Parameters:

*args (tuple) – Tuple with optional (non-keyworded) logging parameters. The value args[0] refers to the label of the treatment plan, while args[1] specifies the minimum logging level.

logger

The external object used to interface the logging methods.

Type:

object of class Logger

Overview

Methods

initialize_logger(label, min_log_level)

Initialize the logger by specifying the channel name, handlers, and formatters.

display_to_console(level, formatted_string, *args)

Call the display function specified by level for the message given by formatted_string.

display_debug(formatted_string, *args)

Display a logging message for the level ‘debug’.

display_info(formatted_string, *args)

Display a logging message for the level ‘info’.

display_warning(formatted_string, *args)

Display a logging message for the level ‘warning’.

display_error(formatted_string, *args)

Display a logging message for the level ‘error’.

display_critical(formatted_string, *args)

Display a logging message for the level ‘critical’.

Members

initialize_logger(label, min_log_level)[source]

Initialize the logger by specifying the channel name, handlers, and formatters.

Parameters:
  • label (str) – Label of the treatment plan instance.

  • min_log_level ({'debug', 'info', 'warning', 'error', 'critical'}) – Minimum logging level for broadcasting messages to the console and the object streams.

display_to_console(level, formatted_string, *args)[source]

Call the display function specified by level for the message given by formatted_string.

Parameters:
  • level ({'debug', 'info', 'warning', 'error', 'critical'}) – Level of the logging message.

  • formatted_string (str) – Formatted string to be displayed.

  • *args (tuple) – Optional display parameters.

display_debug(formatted_string, *args)[source]

Display a logging message for the level ‘debug’.

Parameters:
  • formatted_string (str) – Formatted string to be displayed.

  • *args (tuple) – Optional display parameters.

display_info(formatted_string, *args)[source]

Display a logging message for the level ‘info’.

Parameters:
  • formatted_string (str) – Formatted string to be displayed.

  • *args (tuple) – Optional display parameters.

display_warning(formatted_string, *args)[source]

Display a logging message for the level ‘warning’.

Parameters:
  • formatted_string (str) – Formatted string to be displayed.

  • *args (tuple) – Optional display parameters.

display_error(formatted_string, *args)[source]

Display a logging message for the level ‘error’.

Parameters:
  • formatted_string (str) – Formatted string to be displayed.

  • *args (tuple) – Optional display parameters.

display_critical(formatted_string, *args)[source]

Display a logging message for the level ‘critical’.

Parameters:
  • formatted_string (str) – Formatted string to be displayed.

  • *args (tuple) – Optional display parameters.