Added timestamp to logger (#646)

* 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 95d18d5b6f.

incorrect bramch for this commit
This commit is contained in:
theCyberTech - Rip&Tear
2024-05-26 12:32:16 +08:00
committed by Braelyn Boynton
parent e2dfba63cd
commit 0dd4f444ea

View File

@@ -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)