From 1729c1c5b7c8c2d5b8a2319a38d6c5cdb7fe6753 Mon Sep 17 00:00:00 2001 From: iyuepan Date: Sat, 9 Mar 2024 22:25:00 -0500 Subject: [PATCH] Replaced the deprecating function datatime.utcnow(). --- watchtower/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/watchtower/__init__.py b/watchtower/__init__.py index 4deee19..0c0a892 100644 --- a/watchtower/__init__.py +++ b/watchtower/__init__.py @@ -9,7 +9,7 @@ import time import warnings from collections.abc import Mapping -from datetime import date, datetime +from datetime import date, datetime, timezone from operator import itemgetter from typing import Any, Callable, List, Optional, Tuple @@ -314,7 +314,7 @@ def _get_stream_name(self, message): process_id=os.getpid(), thread_name=threading.current_thread().name, logger_name=message.name, - strftime=datetime.utcnow(), + strftime=datetime.now(timezone.utc), ) def _size(self, msg):