dqm.utils package
Submodules
dqm.utils.twe_logger module
The confiance_logger module provides a preconfigured logger for logging messages with specified formatting and output control. It can log messages to the standard output, to a specified file, or both.
- Usage:
- Import the module and get the default logger:
import twe_logger logger = twe_logger.get_logger()
If you need a logger with different parameters, call get_logger with the desired parameters:
logger = twe_logger.get_logger(filename=”my_logs.log”) logger = twe_logger.get_logger(name=”my_logger”, level=’debug’, filename=’my_logs.log’, output=”both”)
Then, use the logger within your code:
logger.info(“This is an info message”) logger.error(“This is an error message”)
- dqm.utils.twe_logger.get_logger(name='twe_logger', level='debug', filename=None, output=None)[source]
Creates and returns a logger.
- Parameters:
name (str, optional) – The name of the logger.
level (int or str, optional) – The logging level.
filename (str, optional) – The name of the file where the logger should write.
output (str, optional) – Where should the logger write. Can be ‘stdout’, ‘file’, or ‘both’.
- Returns:
The logger.
- Return type:
logging.Logger