Skip to content

Commit 9bfc5fe

Browse files
authored
Merge pull request #21 from HBClab/dev
add logging info; add appending functionality
2 parents 89c3355 + 64e834e commit 9bfc5fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

accel_code/run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def main():
5555
logger = logging.getLogger(__name__)
5656
logger.level = 10
5757
# create file handler which logs even debug messages
58-
fh = logging.FileHandler(logging_path)
58+
fh = logging.FileHandler(logging_path, mode='a')
5959
fh.setLevel(logging.DEBUG)
6060
# create console handler with a higher log level
6161
ch = logging.StreamHandler()
@@ -67,6 +67,8 @@ def main():
6767
# add the handlers to the logger
6868
logger.addHandler(fh)
6969
logger.addHandler(ch)
70+
# add new log header
71+
logger.info('\n##########\n')
7072

7173
# get session and project information
7274
try:
@@ -100,7 +102,7 @@ def main():
100102
msg = "could not copy file: {} ({})"
101103
logger.exception(msg.format(lab_id, str(date)))
102104
raise(e)
103-
105+
104106
if file_copied:
105107
logger.info("{of} -> {nf}".format(of=opts.old_file_path, nf=new_file_path))
106108

0 commit comments

Comments
 (0)