App Logger
This module sets up global logging configurations for the application.
It reads the logging configuration from a YAML file, sets up the logging directory, and provides a function to create and configure individual loggers.
- Functions:
create_logger: Create and configure a logger using global settings.
Usage Example:
from logger_setup import create_logger
logger = create_logger(__name__)
logger.info("This is an info message.")
- reemission.app_logger.create_logger(logger_name: str, formatter: ~logging.Formatter = <logging.Formatter object>, handlers: ~typing.Tuple[~logging.Handler, ...] = (<FileHandler /home/runner/work/reemission/reemission/tmp/reemission/reemission.log (NOTSET)>, <StreamHandler <stdout> (NOTSET)>), logging_level: str | int | None = None) Logger [source]
Create and setup a logger using global settings.
- Parameters:
logger_name (str) – Name of the logger, usually file name given in variable __name__.
formatter (logging.Formatter) – The logging formatter to use. Defaults to global_formatter.
handlers (Tuple[logging.Handler, ...]) – The logging handlers to use. Defaults to global_filehandler and global_streamhandler.
logging_level (Optional[Union[str, int]]) – The logging level to set. If None, uses the global logging level.
- Returns:
Initialized logger object.
- Return type:
logging.Logger