Single log entry that captures execution details.
| 39 | |
| 40 | @dataclass |
| 41 | class LogEntry: |
| 42 | """Single log entry that captures execution details.""" |
| 43 | timestamp: str |
| 44 | level: LogLevel |
| 45 | node_id: Optional[str] = None |
| 46 | event_type: Optional[EventType] = None |
| 47 | message: Optional[str] = None |
| 48 | details: Dict[str, Any] = field(default_factory=dict) |
| 49 | execution_path: List[str] = field(default_factory=list) # Execution path for tracing |
| 50 | duration: Optional[float] = None # Duration in seconds |
| 51 | |
| 52 | def to_dict(self) -> Dict[str, Any]: |
| 53 | return { |
| 54 | "timestamp": self.timestamp, |
| 55 | "level": self.level, |
| 56 | "node_id": self.node_id, |
| 57 | "event_type": self.event_type, |
| 58 | "message": self.message, |
| 59 | "details": self.details, |
| 60 | "execution_path": self.execution_path, |
| 61 | "duration": self.duration |
| 62 | } |
| 63 | |
| 64 | |
| 65 | class WorkflowLogger: |