Skip to content

Commit

Permalink
Add timestamps to the log file
Browse files Browse the repository at this point in the history
  • Loading branch information
erendn committed Oct 5, 2023
1 parent 6a6ac02 commit fe37929
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
import sys
import os
import datetime
import pdb
import inspect
from openram import globals
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fe37929

Please sign in to comment.