Logger Module

Logger functions.

wpt_tools.logger.init_logger(filename='app.log')

Method for initializing logs.

Creates and initializes a logger with specified format, logging messages into a specified file and console. If the root logger already has handlers, it removes them to avoid duplicate logs.

Parameters:

filename (str, optional) – The name of the log file to which the logger will write the logs, by default ‘app.log’

Notes

The format of each logging message: {timestamp} : {level name} : {filename} - {message}