(self, workflow_id: str = None, log_level: LogLevel = LogLevel.DEBUG, use_structured_logging: bool = True, log_to_console: bool = True)
| 66 | """Workflow logger that tracks the entire execution lifecycle.""" |
| 67 | |
| 68 | def __init__(self, workflow_id: str = None, log_level: LogLevel = LogLevel.DEBUG, use_structured_logging: bool = True, log_to_console: bool = True): |
| 69 | self.workflow_id = workflow_id or f"workflow_{datetime.now().strftime('%Y%m%d_%H%M%S')}" |
| 70 | self.logs: List[LogEntry] = [] |
| 71 | self.start_time = datetime.now() |
| 72 | self.current_path: List[str] = [] |
| 73 | self.log_level: LogLevel = log_level |
| 74 | |
| 75 | self.log_to_console: bool = log_to_console |
| 76 | self.use_structured_logging = use_structured_logging |
| 77 | self.structured_logger: Optional[StructuredLogger] = None |
| 78 | if use_structured_logging: |
| 79 | self.structured_logger = get_workflow_logger(self.workflow_id) |
| 80 | |
| 81 | def add_log(self, level: LogLevel, message: str = None, node_id: str = None, |
| 82 | event_type: EventType = None, details: Dict[str, Any] = None, |
nothing calls this directly
no test coverage detected