modular_trader.logging.trade#
Classes#
A logger that logs messages to a file. |
Module Contents#
- class modular_trader.logging.trade.TradingLogger(logger: loguru._logger.Logger = logger)#
Bases:
modular_trader.logging.base.BaseLogger
A logger that logs messages to a file.
This logger logs messages to a file. The file will be rotated when it reaches a certain size, and old files will be deleted after a certain number of days.
- Attributes:
logger (Logger): The underlying logger. file_path (os.PathLike): The path to the log file. rotation_size_mb (int): The maximum size of the log file before it is
rotated. If
None
, the file will not be rotated.- retention_days (int): The number of days to keep old log files. If
None
, old files will not be deleted.
- Parameters:
logger (loguru._logger.Logger)
- __post_init__()#
- file_path: os.PathLike = None#
- logger: loguru._logger.Logger = None#
- retention_days: int = None#
- rotation_size_mb: int = None#