return_logger

HSTB.kluster.logging_conf.return_logger(name, logfile=None)

Built to support logging within the kluster system. Each instance of each class gets a separate logger, identified by the name attribute passed in here. This is important because each instance of the kluster processing that is running should be driven to that instance’s log file. So we need them all segregated.

If logfile is included, the file handler is added to the log so that the output is also driven to file.

I disable the root logger by clearing out it’s handlers because it always gets a default stderr log handler that ends up duplicating messages. Since I want the stderr messages formatted nicely, I want to setup that handler myself.

Parameters
  • name (str, identifier used to name the logger instance. Currently something like 'fqpr_generation_3252' where the) – integer appended is the unique id of the logger instance

  • logfile (str, path to the log file where you want the output driven to) –

Returns

logger

Return type

logging.Logger instance for the provided name/logfile