mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39: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
|
# Setup Logger
|
||||||
rich_handler = RichHandler(rich_tracebacks=True)
|
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])
|
logging.basicConfig(handlers=[rich_handler])
|
||||||
|
|
||||||
logger = logging.getLogger("khoj")
|
logger = logging.getLogger("khoj")
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class ThreadedGenerator:
|
|||||||
def send(self, data):
|
def send(self, data):
|
||||||
if self.response == "":
|
if self.response == "":
|
||||||
time_to_first_response = perf_counter() - self.start_time
|
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.response += data
|
||||||
self.queue.put(data)
|
self.queue.put(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user