Fix timestamps to separate each logline. Info log response start time

This commit is contained in:
Debanjum Singh Solanky 2024-02-07 20:45:16 +05:30
parent 667b975400
commit 70f74cde68
2 changed files with 2 additions and 2 deletions

View file

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

View file

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