From fe379297be81b2b444fd8fdae452aeadee7f17ab Mon Sep 17 00:00:00 2001 From: Eren Dogan Date: Thu, 5 Oct 2023 14:55:05 -0700 Subject: [PATCH] Add timestamps to the log file --- compiler/debug.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/debug.py b/compiler/debug.py index b085e2981..5a7e9b5a1 100644 --- a/compiler/debug.py +++ b/compiler/debug.py @@ -7,6 +7,7 @@ # import sys import os +import datetime import pdb import inspect from openram import globals @@ -62,6 +63,9 @@ def print_raw(str): def log(str): + # Add timestamp at the beginning of the string + timestr = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f") + str = "[{}] {}".format(timestr, str) if globals.OPTS.output_name != '': if log.create_file: # We may have not yet read the config, so we need to ensure