pypeit.pypmsgs module
Module for terminal and file logging.
Todo
Why not use pythons native logging package?
- class pypeit.pypmsgs.Messages(log=None, verbosity=None, colors=True)[source]
Bases:
object
Create coloured text for messages printed to screen.
For further details on colours see the following example: http://ascii-table.com/ansi-escape-sequences.php
- Parameters
- reset(log=None, verbosity=None, colors=True)[source]
Reinitialize the object.
Needed so that there can be a default object for all modules, but also a dynamically defined log file.
- set_logfile_and_verbosity(scriptname, verbosity)[source]
Set the logfile name and verbosity level for a script run.
PypeIt scripts (with the exception of run_pypeit) default to verbosity level = 1. For certain scripts, having a more verbose output (with an accompanying log file) would be helpful for debugging purposes. This function provides the ability to set the
msgs
verbosity and create a log file for those certain scripts.Log filenames have the form scriptname_YYYYMMDD_HHMM.log to differentiate between different runs of the script. Timestamp is UT.
- exception pypeit.pypmsgs.PypeItDataModelError[source]
Bases:
PypeItError