summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-10-10 16:51:11 +0200
committerLars-Dominik Braun <lars@6xq.net>2018-10-10 16:53:27 +0200
commit68c9c012efb84817685a889f100d207cc75fb2c2 (patch)
tree4df1d08d7e2056205354f09e4ef033608dd5a0ca
parent820cbcdbbdac176b97752d3619d52a5ca76b7bb3 (diff)
downloadcrocoite-68c9c012efb84817685a889f100d207cc75fb2c2.tar.gz
crocoite-68c9c012efb84817685a889f100d207cc75fb2c2.tar.bz2
crocoite-68c9c012efb84817685a889f100d207cc75fb2c2.zip
Add timezone to logger dates
UTC everywhere. Make that clear.
-rw-r--r--crocoite/logger.py4
-rw-r--r--setup.py1
2 files changed, 4 insertions, 1 deletions
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):
diff --git a/setup.py b/setup.py
index 2b8ff6f..0ca55f8 100644
--- a/setup.py
+++ b/setup.py
@@ -14,6 +14,7 @@ setup(
'warcio',
'html5lib>=0.999999999',
'bottom',
+ 'pytz',
],
entry_points={
'console_scripts': [