Skip to content

Commit

Permalink
add support for Python 3.12 in setup, fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianClemenz authored and lnagel committed Nov 21, 2024
1 parent f2b06cd commit bc53318
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 1 addition & 6 deletions django_datadog_logger/formatters/datadog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
import typing
from logging import LogRecord

try:
import zoneinfo
except ImportError:
from backports import zoneinfo

import json_log_formatter
from django.conf import settings
from django.core.exceptions import DisallowedHost
Expand Down Expand Up @@ -82,7 +77,7 @@ def json_record(self, message: str, extra: typing.Dict, record: LogRecord) -> ty
"logger.thread_name": record.threadName,
"logger.method_name": record.funcName,
"date": (
datetime.datetime.utcfromtimestamp(record.created).replace(tzinfo=zoneinfo.ZoneInfo("UTC")).isoformat()
datetime.datetime.fromtimestamp(record.created, tz=datetime.UTC).isoformat()
),
"status": record.levelname,
}
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
description="Django DataDog Logger integration package.",
install_requires=requirements,
Expand Down

0 comments on commit bc53318

Please sign in to comment.