metobs_toolkit.add_FileHandler#
- add_FileHandler(trglogfile: str, setlvl: str = 'DEBUG', logformat: str = 'LOG:: %(levelname)s - %(message)s', clearlog: bool = True) None[source]#
Add a FileHandler to the Toolkit logger.
A FileHandler directs the logs generated by the metobs_toolkit to a file.
- Parameters:
trglogfile (str) – Path of the target log file.
setlvl ({"DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"}, optional) – The logger level for the FileHandler. See https://docs.python.org/3/library/logging.html#levels for more details. The default is “DEBUG”.
logformat (str, optional) – The format of the log messages. The default is “LOG:: %(levelname)s - %(message)s”.
clearlog (bool, optional) – If True, the trglogfile is cleared before adding the FileHandler. The default is True.
- Return type:
None