Logging Configuration
Configure the loguru logger with custom settings. Check Loguru Documentation for more details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
format_string
|
str
|
The format string for log messages. |
'<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>'
|
level
|
str
|
The minimum logging level. Default: "INFO" |
'INFO'
|
sink
|
Union[PathLike[str], TextIO, BinaryIO]
|
Where to send the log. Default: sys.stderr |
stderr
|
rotation
|
str
|
When to rotate the log file. Example: "10 MB", "1 day" Only used when sink is a file path. |
None
|
retention
|
str
|
How long to keep log files. Example: "1 week", "10 days" Only used when sink is a file path. |
None
|
include_correlation_id
|
bool
|
Whether to include correlation ID in log messages. Default: True |
True
|
Returns:
| Type | Description |
|---|---|
Logger
|
The configured logger object |