compass.utilities.logs.LocationFileLog#

class LocationFileLog(listener, log_dir, location, level='INFO', max_teardown_time=30)[source]#

Bases: object

Context manager to write logs for a location to a unique file

Parameters:
  • listener (LoggingListener) – A listener instance. The file handler will be added to this listener.

  • log_dir (path-like) – Path to output directory to contain log file.

  • location (str) – Location identifier. For example, "El Paso Colorado". This string will become part of the file name, so it must contain only characters valid in a file name.

  • level (str, optional) – Log level. By default, "INFO".

  • max_teardown_time (int | float, default 30) – Max number of seconds to wait for logs to flush to file before unhooking the handler from the queue listener. By default, 30.

Methods

Attributes

TEXT_FORMATTER

Formatter used for text logs

TEXT_FORMATTER = <logging.Formatter object>#

Formatter used for text logs