mirror of https://github.com/VLSIDA/OpenRAM.git
Add timestamps to the log file
This commit is contained in:
parent
6a6ac026db
commit
fe379297be
|
|
@ -7,6 +7,7 @@
|
||||||
#
|
#
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import datetime
|
||||||
import pdb
|
import pdb
|
||||||
import inspect
|
import inspect
|
||||||
from openram import globals
|
from openram import globals
|
||||||
|
|
@ -62,6 +63,9 @@ def print_raw(str):
|
||||||
|
|
||||||
|
|
||||||
def log(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 globals.OPTS.output_name != '':
|
||||||
if log.create_file:
|
if log.create_file:
|
||||||
# We may have not yet read the config, so we need to ensure
|
# We may have not yet read the config, so we need to ensure
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue