add_file_handler

HSTB.kluster.logging_conf.add_file_handler(logger, logfile, remove_existing=True)

Take an existing logger and add a new file handler to it, to save the log output to file. If you remove_existing, will remove all existing file handlers from the logger.

Parameters
  • logger (Logger) – logger instance

  • logfile (str) – file path to where you want to save the log ouput

  • remove_existing (bool) – if True, removes all existing file handlers from the log

Return type

logging.Logger