Skip to content

Commit

Permalink
now the logs are placed in a subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
gj1118 committed Nov 13, 2016
1 parent 6e2cf0e commit 1a0f8db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion installTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@

def createLogger():
global logger
logFile = "installTools_{0}.log".format(datetime.datetime.now().strftime('%Y_%m_%d %H_%M_%S'))

# first check if the log directory exists
if(not os.path.exists("logs")):
# create the log directory
os.makedirs("logs")

# the log directory should exist now.
logFile = "logs\\installTools_{0}.log".format(datetime.datetime.now().strftime('%Y_%m_%d %H_%M_%S'))
# logFile = "installTools.log"
logger = logging.getLogger("Rotating Log")
logger.setLevel(logging.INFO)
Expand Down

0 comments on commit 1a0f8db

Please sign in to comment.