Add timestamps to debug messages

Useful in log files to see when things are running

Change-Id: Ie19faf9dd0bab8545f96a2977f37c7387823e24c
This commit is contained in:
Ian Wienand 2018-06-13 05:55:23 +10:00
parent 494a12801b
commit bf39628920
1 changed files with 2 additions and 1 deletions

View File

@ -117,9 +117,10 @@ class AFSMonCmd(object):
self.config = configparser.RawConfigParser()
self.config.read(self.args.config)
logfmt = '%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
if self.args.debug or \
self.config.getboolean('main', 'debug', fallback=False):
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG, format=logfmt)
logger.debug("Debugging enabled")
if not self.args.command: