holodeck.logger

Logging module.

This module produces a logging.Logger instance that can log both to stdout (i.e. using print) and also to an output file. This is especially useful for long or parallelized calculations where more significant diagnostic outputs are required for debugging and/or record-keeping.

holodeck.logger.get_logger(name='holodeck', level_stream=30, tostr=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, tofile=None, level_file=10)[source]

Create a standard logger object which logs to file and or stdout stream.

Parameters:
  • name (str,) – Handle for this logger, must be distinct for a distinct logger.

  • level_stream (int,) – Logging level for stream.

  • tostr (bool,) – Log to stdout stream.

  • tofile (str or None,) – Filename to log to (turned off if None).

  • level_file (int,) – Logging level for file.

Returns:

logger – Logger object to use for logging.

Return type:

logging.Logger object,