Commit 0e6be66a authored by Dimitris Lampridis's avatar Dimitris Lampridis

write file name as first line in log files

parent 6b780e1a
...@@ -152,13 +152,13 @@ if __name__ == '__main__': ...@@ -152,13 +152,13 @@ if __name__ == '__main__':
now = now.replace(" ","-") now = now.replace(" ","-")
now = now.replace(":","-") now = now.replace(":","-")
lgf = "%s/log/%s-%s-%s-%s-%1d.log" % (dir,bnm,sno,xno,now,lun) log_file = "%s/log/%s-%s-%s-%s-%1d.log" % (dir,bnm,sno,xno,now,lun)
inf = "%s/log/%s-%s-%s-%s-%1d.inf" % (dir,bnm,sno,xno,now,lun) inf_file = "%s/log/%s-%s-%s-%s-%1d.inf" % (dir,bnm,sno,xno,now,lun)
# Open the log and info files # Open the log and info files
try: try:
log = open(lgf, "w") log = open(log_file, "w")
inf = open(inf, "w") inf = open(inf_file, "w")
except Exception, e: except Exception, e:
msg = "Exception: %s" % (e) msg = "Exception: %s" % (e)
...@@ -168,11 +168,15 @@ if __name__ == '__main__': ...@@ -168,11 +168,15 @@ if __name__ == '__main__':
# and print them to console if in debug mode # and print them to console if in debug mode
if options.debug: if options.debug:
print "\n" print "\n"
print "Log file is: %s" % lgf print "Log file is: %s" % log_file
print "Inf file is: %s" % inf print "Inf file is: %s" % inf_file
print "\n" print "\n"
# write file name as first line in file
inf.write(inf_file + '\n')
log.write(log_file + '\n')
# Open up a bus object, can be one of following (depending on tested device): # Open up a bus object, can be one of following (depending on tested device):
# * VME -- VME board (SVEC, etc.) # * VME -- VME board (SVEC, etc.)
# * PCI -- PCI board (SPEC, etc.) # * PCI -- PCI board (SPEC, etc.)
...@@ -294,8 +298,8 @@ if __name__ == '__main__': ...@@ -294,8 +298,8 @@ if __name__ == '__main__':
# Print info file to console if in debug mode # Print info file to console if in debug mode
if options.debug: if options.debug:
print "Debug: printing:%s" % (inf) print "Debug: printing:%s" % (inf_file)
inf = open(inf, "r") inf = open(inf_file, "r")
try: try:
for line in inf: for line in inf:
l = line.split("\n") l = line.split("\n")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment