MCPcopy
hub / github.com/OpenBMB/ChatDev / __init__

Method __init__

utils/logger.py:68–79  ·  view source on GitHub ↗
(self, workflow_id: str = None, log_level: LogLevel = LogLevel.DEBUG, use_structured_logging: bool = True, log_to_console: bool = True)

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 1

get_workflow_loggerFunction · 0.90

Tested by

no test coverage detected