Skip to content

Commit

Permalink
Added timestamp to logger (crewAIInc#646)
Browse files Browse the repository at this point in the history
* 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:

* Update tool_usage.py

* Revert "Update tool_usage.py"

This reverts commit 95d18d5.

incorrect bramch for this commit
  • Loading branch information
theCyberTech authored May 26, 2024
1 parent 48948e1 commit bf40956
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/crewai/utilities/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ def __init__(self, verbose_level=0):
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)

0 comments on commit bf40956

Please sign in to comment.