From bf396289205ee3e3e100defe634c1670533ce71c Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 13 Jun 2018 05:55:23 +1000 Subject: [PATCH] Add timestamps to debug messages Useful in log files to see when things are running Change-Id: Ie19faf9dd0bab8545f96a2977f37c7387823e24c --- afsmon/cmd/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsmon/cmd/main.py b/afsmon/cmd/main.py index 0f6c66a..aed861f 100644 --- a/afsmon/cmd/main.py +++ b/afsmon/cmd/main.py @@ -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: