Add timestamp when logging to file

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2020-11-25 17:35:19 +01:00
parent d38907dc35
commit 28a066e79a
No known key found for this signature in database
GPG key ID: FF42D23B580C89F7

View file

@ -66,7 +66,8 @@ def validate_config(config):
def setup_logging(args):
logging.basicConfig(format='%(levelname)s: %(message)s', level=args.loglevel, filename=args.logfile)
log_format = '%(asctime)s %(levelname)s: %(message)s' if args.logfile else '%(levelname)s: %(message)s'
logging.basicConfig(format=log_format, level=args.loglevel, filename=args.logfile)
def markdown_escape(text):