logging
logging ¶
Logging configuration for the flow system.
FlowFormatter ¶
FlowFormatter(include_process_thread: bool = False)
Bases: Formatter
Custom formatter for flow system logs.
Format example: 2024-01-24 15:30:45.123 [INFO][FlowName:abc123] Started execution - {"context": "additional data"} 2024-01-24 15:30:46.234 [ERROR][FlowName:abc123] Execution failed - {"error": "details", "traceback": "..."}
Source code in src/flow/core/logging.py
format ¶
Format the log record.
Source code in src/flow/core/logging.py
FlowLogger ¶
FlowLogger(name: str)
Enhanced logger for flow system with context management.
Source code in src/flow/core/logging.py
flow_context ¶
Context manager for adding flow-specific context to logs.
Source code in src/flow/core/logging.py
setup_logging ¶
setup_logging(
log_file: Optional[str] = None,
level: int = INFO,
max_bytes: int = 10485760,
backup_count: int = 5,
include_process_thread: bool = False,
) -> None
Set up logging configuration for the flow system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
log_file
|
Optional[str]
|
Optional path to log file. If None, logs to console only |
None
|
level
|
int
|
Minimum logging level |
INFO
|
max_bytes
|
int
|
Maximum size of each log file |
10485760
|
backup_count
|
int
|
Number of backup log files to keep |
5
|
include_process_thread
|
bool
|
Whether to include process and thread IDs in logs |
False
|