logger¶
Functions¶
|
Logger configuration with both console and file handlers. |
Module Contents¶
- setup_logger(name: str, file_name: str = None) logging.Logger ¶
Logger configuration with both console and file handlers.
The logger will output debug-level messages to the console and info-level messages to a file named ‘app.log’. The log format includes the timestamp, logger name, log level, and message.
- Parameters:
name (str) – The name of the logger, typically the module’s __name__.
- Returns:
A configured logger instance with handlers attached.
- Return type:
logging.Logger