mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Fix timestamps to separate each logline. Info log response start time
This commit is contained in:
@@ -84,7 +84,7 @@ from khoj.utils.initialization import initialization
|
||||
|
||||
# Setup Logger
|
||||
rich_handler = RichHandler(rich_tracebacks=True)
|
||||
rich_handler.setFormatter(fmt=logging.Formatter(fmt="%(message)s", datefmt="[%X]"))
|
||||
rich_handler.setFormatter(fmt=logging.Formatter(fmt="%(message)s", datefmt="[%H:%M:%S.%f]"))
|
||||
logging.basicConfig(handlers=[rich_handler])
|
||||
|
||||
logger = logging.getLogger("khoj")
|
||||
|
||||
@@ -56,7 +56,7 @@ class ThreadedGenerator:
|
||||
def send(self, data):
|
||||
if self.response == "":
|
||||
time_to_first_response = perf_counter() - self.start_time
|
||||
logger.debug(f"First response took: {time_to_first_response:.3f} seconds")
|
||||
logger.info(f"First response took: {time_to_first_response:.3f} seconds")
|
||||
|
||||
self.response += data
|
||||
self.queue.put(data)
|
||||
|
||||
Reference in New Issue
Block a user