Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Fix according to flake8 & mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
abhabongse committed Mar 20, 2024
1 parent c83b95c commit e9f7b5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/myhelpers/primitives/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import logging
import logging.config
import logging.handlers
import tomllib
import zoneinfo
import tomllib # noqa: I
import zoneinfo # noqa: I
from os import PathLike
from typing import Any, Literal, override

Expand All @@ -19,7 +19,7 @@
__all__ = ["setup_logging", "RichFormatter", "JSONFormatter"]

_LOG_RECORD_BUILTIN_ATTRS = logging.LogRecord(
"name", 0, "pathname", 0, "msg", (), None
"name", 0, "pathname", 0, "msg", (), None,
).__dict__.keys() | ["asctime"]

THEME = Theme({
Expand Down Expand Up @@ -116,7 +116,7 @@ def _prepare_log_dict(self, record: logging.LogRecord) -> dict[str, str]:
"message": record.getMessage(),
"timestamp": (dt.datetime.fromtimestamp(record.created, tz=dt.timezone.utc)
.astimezone(zoneinfo.ZoneInfo(self.timezone))
.strftime(self.datefmt)),
.strftime(self.datefmt or "%Y-%m-%dT%H:%M:%S%z")),
}
if record.exc_info:
always_fields["exc_info"] = self.formatException(record.exc_info)
Expand Down

0 comments on commit e9f7b5e

Please sign in to comment.