From 68c9c012efb84817685a889f100d207cc75fb2c2 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 10 Oct 2018 16:51:11 +0200 Subject: Add timezone to logger dates UTC everywhere. Make that clear. --- crocoite/logger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crocoite') diff --git a/crocoite/logger.py b/crocoite/logger.py index e8ff594..1a269b1 100644 --- a/crocoite/logger.py +++ b/crocoite/logger.py @@ -32,6 +32,8 @@ from datetime import datetime from functools import partial from enum import IntEnum +from pytz import utc + class Level(IntEnum): DEBUG = 0 INFO = 1 @@ -124,7 +126,7 @@ class JsonPrintConsumer (Consumer): class DatetimeConsumer (Consumer): def __call__ (self, **kwargs): - kwargs['date'] = datetime.utcnow () + kwargs['date'] = datetime.utcnow ().replace (tzinfo=utc) return kwargs class WarcHandlerConsumer (Consumer): -- cgit v1.2.3