Skip to content

Commit

Permalink
Added time String to logging folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestaylr committed Aug 8, 2015
1 parent 3b73263 commit 6816094
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ def setup_logging():
log_path = r'logs/'
if not os.path.exists(log_path): os.makedirs(log_path)

file_handler = logging.FileHandler('logs/' + time.strftime("%Y-%m-%d %H-%M-%S") + '.log')
if ('name' in keyword_parameters):
file_handler = logging.FileHandler('logs/' + time.strftime("%Y-%m-%d %H-%M-%S") + '/' + keyword_parameters['name'] + '.log')
else:
file_handler = logging.FileHandler('logs/' + time.strftime("%Y-%m-%d %H-%M-%S") + '/' + "undefined" + '.log')

file_handler.setLevel(logging.DEBUG)

formatterDisplay = logging.Formatter('[%(asctime)s] %(levelname)-0s: %(message)s', '%H:%M:%S')
Expand Down

0 comments on commit 6816094

Please sign in to comment.