eta_nexus.util.logging_utils module
- eta_nexus.util.logging_utils.get_logger(level: int = 10, log_format: str = 'simple') Logger[source]
Get eta_nexus specific logger.
This function initializes and configures the eta_nexus’s logger with the specified logging level and format. By default, this logger will not propagate to the root logger, ensuring that eta_nexus’s logs remain isolated unless otherwise configured.
Using this function is optional. The logger can be accessed and customized manually after retrieval.
- Parameters:
level – Logging level (lower is more verbose between 10 - Debugging and 40 - Errors).
log_format – Format of the log output. One of: simple, logname, time. (default: simple).
- Returns:
The eta_nexus logger.
- eta_nexus.util.logging_utils.log_add_filehandler(filename: Path | None = None, level: int = 1, log_format: str = 'time') logging.Logger[source]
Add a file handler to the logger to save the log output.
- Parameters:
filename – File path where logger is stored.
level – Logging level (higher is more verbose between 0 - no output and 4 - debug).
log_format – Format of the log output. One of: simple, logname, time. (default: time).
- Returns:
The FileHandler logger.
- eta_nexus.util.logging_utils.log_add_streamhandler(level: int = 10, log_format: str = 'simple', stream: io.TextIOBase | Any = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) logging.Logger[source]
Add a stream handler to the logger to show the log output.
- Parameters:
level – Logging level (lower is more verbose between 10 - Debugging and 40 - Errors).
format – Format of the log output. One of: simple, logname, time. (default: time).
- Returns:
The eta_nexus logger with an attached StreamHandler