pynitride.core.logging module

pynitride.core.logging.log(msg, level='info')

Logs a message if it is severe enough.

For info on the severity setting, see set_level()

Parameters:
  • msg – the string to log

  • level – the severity of the message, one of “error”, “warning”, “info”, “debug”, “TODO”

pynitride.core.logging.log_fail()

Convenience function which logs the most recent traceback.

pynitride.core.logging.set_level(level=None)

Sets the minimum severity for a message to be printed.

The log() function will ignore messages below the set level.

Parameters:

level – the severity of the message, one of “error”, “warning”, “info”, “debug”, “TODO”. Or None, to use the default from config.ini

pynitride.core.logging.start_log_file(filename, overwrite=True)

Establishes a log file to direct subsequent messages

Parameters:
  • filename – path of the log file

  • overwrite – whether to overwrite or append

pynitride.core.logging.sublog(msg, level='info')

Context manager to log a message and temporarily indent further messages

Parameters:
  • msg – the “heading” message

  • level – the severity, see log()