Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format logging datetime as ISO 8601 UTC #73

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog], and this project adheres to
- [#14](https://github.com/MAAP-Project/gedi-subsetter/issues/14) AWS S3
credentials are no longer obtained via the `maap-py` library. Instead, they
are obtained via a role using the EC2 instance metadata.
- [#72](https://github.com/MAAP-Project/gedi-subsetter/issues/72) Log messages
now use ISO 8601 UTC combined date and time representations with milliseconds.

## 0.7.0 (2024-04-23)

Expand Down
5 changes: 5 additions & 0 deletions src/gedi_subset/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import multiprocessing
import os
import os.path
import time
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Callable, Iterable, Mapping, NoReturn, Optional, Sequence, Tuple
Expand Down Expand Up @@ -49,6 +50,10 @@
LOGGING_FORMAT = "%(asctime)s [%(processName)s:%(name)s] [%(levelname)s] %(message)s"

logging.basicConfig(level=logging.INFO, format=LOGGING_FORMAT)
logging.Formatter.converter = time.gmtime
logging.Formatter.default_time_format = "%Y-%m-%dT%H:%M:%S"
logging.Formatter.default_msec_format = "%s,%03dZ"

logger = logging.getLogger("gedi_subset")


Expand Down