libgs.utils.setup_logger

libgs.utils.setup_logger(logger, cons_loglvl=20, file_logpath=None, file_loglvl=20, fmt='%(asctime)s - %(name)14s - %(levelname)5s - %(module)20s:%(lineno)4s - "%(message)s"')[source]

Function to set up logging for libgs. Should only ever be called once.

It sill set up logging to console and to file if requested.

It will also make sure all logging is timestamped in UTC time following ISO 8601

Parameters:
  • logger – The log to setup
  • cons_loglvl – log level for console logging,
  • file_logpath – Path to log to if logging to file (None for no file logging),
  • file_loglvl – log level for file log
  • fmt – log formatting string