mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
Added timestamp to logger
Updated the logger.py file to include timestamps when logging output. For example: [2024-05-20 15:32:48][DEBUG]: == Working Agent: Researcher [2024-05-20 15:32:48][INFO]: == Starting Task: Research the topic [2024-05-20 15:33:22][DEBUG]: == [Researcher] Task output:
This commit is contained in:
committed by
GitHub
parent
a336381849
commit
370e7795db
@@ -13,4 +13,6 @@ class Logger:
|
||||
def log(self, level, message, color="bold_green"):
|
||||
level_map = {"debug": 1, "info": 2}
|
||||
if self.verbose_level and level_map.get(level, 0) <= self.verbose_level:
|
||||
self._printer.print(f"[{level.upper()}]: {message}", color=color)
|
||||
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
self._printer.print(f"[{timestamp}][{level.upper()}]: {message}", color=color)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user