Update log_tool.py to use metrics
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# tools/log_tool.py
|
# tools/log_tool.py
|
||||||
|
|
||||||
from .base_tool import BaseTool
|
from .base_tool import BaseTool
|
||||||
|
from .metrics import metrics
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
@@ -49,6 +50,7 @@ class LogTool(BaseTool):
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@metrics.measure
|
||||||
def execute(self, function_name, **kwargs):
|
def execute(self, function_name, **kwargs):
|
||||||
self.logger.info(f"Executing: {function_name}")
|
self.logger.info(f"Executing: {function_name}")
|
||||||
|
|
||||||
@@ -59,6 +61,7 @@ class LogTool(BaseTool):
|
|||||||
self.logger.error(error_message)
|
self.logger.error(error_message)
|
||||||
return error_message
|
return error_message
|
||||||
|
|
||||||
|
@metrics.measure
|
||||||
def _get_log_contents(self, line_count=150):
|
def _get_log_contents(self, line_count=150):
|
||||||
log_file_path = 'logs/output.log'
|
log_file_path = 'logs/output.log'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user