initiate_logger

despasito.initiate_logger

initiate_logger(console=None, log_file=None, verbose=30)[source]

Initiate a logging handler if more detail on the calculations is desired.

This function is useful when DESPASITO is used as an imported package. If a handler of the given type is already present, nothing is done, as is the case when the input file schema is used. If either handler is given a value of False, the handler of that type is removed.

Parameters:
  • console (bool, Optional, default=None) – Initiates a stream handler to print to a console. If True, this handler is initiated. If it is False, then any StreamHandler is removed.

  • log_file (bool/str, Optional, default=None) – If log output should be recorded in a file, set this keyword to either True or to a name for the log file. If True, the file name ‘despasito.log’ is used. Note that if a file with the same name already exists, it will be deleted.

  • verbose (int, Optional, default=30) – The verbosity of logging information can be set to any supported representation of the logging level.

  • .. _LOGGER (https://docs.python.org/3/library/logging.html#logging-levels)