1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00

logging: log timestamps as local timezone instead of UTC (#5607)

* logging: log timestamps as local timezone instead of UTC

* test(logging): expect localtime instead of gmtime

* linter fix in logging
This commit is contained in:
sydneyli
2018-03-21 15:41:33 -07:00
committed by Brad Warren
parent afb6260c34
commit bca0aa48c2
2 changed files with 1 additions and 3 deletions

View File

@@ -19,7 +19,6 @@ import logging.handlers
import os
import sys
import tempfile
import time
import traceback
from acme import messages
@@ -148,7 +147,6 @@ def setup_log_file_handler(config, logfile, fmt):
handler.doRollover() # TODO: creates empty letsencrypt.log.1 file
handler.setLevel(logging.DEBUG)
handler_formatter = logging.Formatter(fmt=fmt)
handler_formatter.converter = time.gmtime # don't use localtime
handler.setFormatter(handler_formatter)
return handler, log_file_path

View File

@@ -156,7 +156,7 @@ class SetupLogFileHandlerTest(test_util.ConfigTestCase):
handler.close()
self.assertEqual(handler.level, logging.DEBUG)
self.assertEqual(handler.formatter.converter, time.gmtime)
self.assertEqual(handler.formatter.converter, time.localtime)
expected_path = os.path.join(self.config.logs_dir, log_file)
self.assertEqual(log_path, expected_path)