ThalamOS
a powerful Flask web application designed to enhance your storage management.
Loading...
Searching...
No Matches
logger_config.py
Go to the documentation of this file.
1"""global logger configuration
2This module configures a global logger using the Loguru library.
3The logger is set up to write log messages to 'storagemanager.log' with the following specifications:
4- Log message format: "{time} {level} {message}"
5- Log level: INFO
6- Log file rotation: 10 MB
7- Log file compression: zip
8- Log file retention: 2 days
9Usage:
10 logger.info("This is an info message")
11 logger.error("This is an error message")
12"""
13from loguru import logger
14
15logger.add(
16 "storagemanager.log",
17 format="{time} {level} {message}",
18 level="INFO",
19 rotation="10 MB",
20 compression="zip",
21 retention="2 days",
22)