navigate.log_files.log_functions.log_setup
- navigate.log_files.log_functions.log_setup(logging_configuration: str, logging_path: Optional[str] = None, queue=None, start_listener=False) → Optional[Union[Queue, tuple[multiprocessing.context.BaseContext.Queue, logging.handlers.QueueListener]]]
Setup logging configuration
Initialize a logger from a YAML file containing information in the Python logging dictionary format.
Note
Additional information here: https://docs.python.org/3/library/logging.config.html#logging-config-dictschema
- Parameters:
logging_configuration (str) – Path to file to be loaded. Relative to the location of the folder containing this file.
logging_path (str, optional) – Path to store logs. Defaults to navigate_path/logs
queue (multiprocessing.Queue, optional) – Queue to use for logging from sub-processes. If None, a new queue will be created if start_listener is True. Defaults to None.
start_listener (bool, optional) – Whether to start a listener for the queue. Defaults to False.
- Returns:
If start_listener is True, returns a tuple containing the queue and the listener. If start_listener is False and a queue is provided, returns the queue. Otherwise, returns None.
- Return type:
Optional[Union[mp.Queue, tuple[mp.Queue, logging.handlers.QueueListener]]]