Skip to content

Commit a4bc2d3

Browse files
committed
v7.0.1
1 parent 3f96f83 commit a4bc2d3

File tree

15 files changed

+54
-72
lines changed

15 files changed

+54
-72
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
github: ddc
2-
ko_fi: ddcsta
2+
ko_fi: ddc
33
custom: "https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ"

.github/PULL_REQUEST_TEMPLATE

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
## Summary
2-
<!-- Brief description of what this PR does and why -->
3-
41
## Changes Made
52
<!-- List the key changes -->
63

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: uv python install ${{ matrix.python-version }}
4343

4444
- name: Install dependencies
45-
run: uv sync --locked --all-extras --group dev
45+
run: uv sync --locked --all-extras --all-groups
4646

4747
- name: Run tests with coverage
4848
uses: nick-fields/retry@v3

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
<a href="https://ko-fi.com/ddc"><img src="https://img.shields.io/badge/Ko--fi-ddc-FF5E5B?style=plastic&logo=kofi&logoColor=white&color=brightgreen" alt="Ko-fi"/></a>
1111
<a href="https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ"><img src="https://img.shields.io/badge/Donate-PayPal-brightgreen.svg?style=plastic&logo=paypal&logoColor=white" alt="Donate"/></a>
1212
<br>
13-
<a href="https://pypi.python.org/pypi/pythonlogs"><img src="https://img.shields.io/pypi/v/pythonlogs.svg?style=plastic&logo=python&cacheSeconds=3600" alt="PyPi"/></a>
14-
<a href="https://pepy.tech/projects/pythonlogs"><img src="https://img.shields.io/pepy/dt/pythonlogs?style=plastic&logo=pypi&logoColor=3776AB" alt="PyPI Downloads"/></a>
15-
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic&logo=creativecommons&logoColor=white" alt="License: MIT"/></a>
16-
<br>
1713
<a href="https://www.python.org/downloads"><img src="https://img.shields.io/pypi/pyversions/pythonlogs.svg?style=plastic&logo=python&cacheSeconds=3600" alt="Python"/></a>
1814
<a href="https://github.com/astral-sh/uv"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json&style=plastic" alt="uv"/></a>
1915
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=plastic" alt="Ruff"/></a>
2016
<br>
17+
<a href="https://pypi.python.org/pypi/pythonlogs"><img src="https://img.shields.io/pypi/v/pythonlogs.svg?style=plastic&logo=python&cacheSeconds=3600" alt="PyPi"/></a>
18+
<a href="https://pepy.tech/projects/pythonlogs"><img src="https://img.shields.io/pepy/dt/pythonlogs?style=plastic&logo=pypi&logoColor=3776AB" alt="PyPI Downloads"/></a>
19+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic&logo=creativecommons&logoColor=white" alt="License: MIT"/></a>
20+
<br>
2121
<a href="https://github.com/ddc/pythonlogs/issues"><img src="https://img.shields.io/github/issues/ddc/pythonlogs?style=plastic&logo=github&logoColor=white" alt="issues"/></a>
2222
<a href="https://codecov.io/gh/ddc/pythonlogs"><img src="https://img.shields.io/codecov/c/github/ddc/pythonlogs?token=XWB53034GI&style=plastic&logo=codecov" alt="codecov"/></a>
2323
<a href="https://sonarcloud.io/dashboard?id=ddc_pythonlogs"><img src="https://img.shields.io/sonar/quality_gate/ddc_pythonlogs?server=https%3A%2F%2Fsonarcloud.io&style=plastic&logo=sonarqubecloud&logoColor=white" alt="Quality Gate Status"/></a>
@@ -285,7 +285,6 @@ LOG_MAX_FILE_SIZE_MB=10
285285
286286
# TimedRotatingLog
287287
LOG_ROTATE_WHEN=midnight
288-
LOG_ROTATE_AT_UTC=True
289288
LOG_ROTATE_FILE_SUFIX="%Y%m%d"
290289
```
291290

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ packages = ["pythonlogs"]
1313

1414
[project]
1515
name = "pythonlogs"
16-
version = "7.0.0"
16+
version = "7.0.1"
1717
description = "High-performance Python logging library with file rotation and optimized caching for better performance"
1818
urls.Repository = "https://github.com/ddc/pythonlogs"
1919
urls.Homepage = "https://pypi.org/project/pythonlogs"
@@ -51,9 +51,9 @@ dependencies = [
5151
[dependency-groups]
5252
dev = [
5353
"psutil>=7.2.2",
54-
"pytest-cov>=7.0.0",
55-
"poethepoet>=0.42.1",
56-
"ruff>=0.15.7",
54+
"pytest-cov>=7.1.0",
55+
"poethepoet>=0.43.0",
56+
"ruff>=0.15.9",
5757
]
5858

5959
[tool.poe.tasks]
@@ -62,7 +62,7 @@ snyk-export.shell = "rm -f requirements.txt && uv export --no-hashes --no-annota
6262
snyk.sequence = ["snyk-export", { shell = "uv pip install pip && snyk test --file=requirements.txt && snyk code test; uv pip uninstall pip" }]
6363
profile = "uv run python -m cProfile -o cprofile_unit.prof -m pytest --no-cov"
6464
tests.sequence = ["linter", {shell = "uv run pytest"}]
65-
updatedev.sequence = ["linter", {shell = "uv lock --upgrade && uv sync --all-extras --group dev"}]
65+
updatedev.sequence = ["linter", {shell = "uv lock --upgrade && uv sync --all-extras --all-groups"}]
6666
build.sequence = ["updatedev", "tests", {shell = "uv build --wheel"}]
6767

6868
[tool.pytest.ini_options]

pythonlogs/.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ LOG_MAX_FILE_SIZE_MB=10
2323

2424
# TimedRotatingLog Settings (only needed when using TimedRotatingLog)
2525
LOG_ROTATE_WHEN=midnight
26-
LOG_ROTATE_AT_UTC=True
2726
LOG_ROTATE_FILE_SUFIX=%Y%m%d
2827

2928

pythonlogs/core/constants.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import logging
22
from enum import StrEnum
3+
from typing import Final
34

45
# File and Directory Constants
5-
MB_TO_BYTES = 1024 * 1024
6-
DEFAULT_FILE_MODE = 0o755
7-
DEFAULT_BACKUP_COUNT = 30
6+
MB_TO_BYTES: Final = 1024 * 1024
7+
DEFAULT_FILE_MODE: Final = 0o755
8+
DEFAULT_BACKUP_COUNT: Final = 30
89

910
# Date Format Constants
10-
DEFAULT_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S"
11-
DEFAULT_ROTATE_SUFFIX = "%Y%m%d"
11+
DEFAULT_DATE_FORMAT: Final = "%Y-%m-%dT%H:%M:%S"
12+
DEFAULT_ROTATE_SUFFIX: Final = "%Y%m%d"
1213

1314
# Encoding Constants
14-
DEFAULT_ENCODING = "UTF-8"
15+
DEFAULT_ENCODING: Final = "UTF-8"
1516

1617
# Timezone Constants
17-
DEFAULT_TIMEZONE = "UTC"
18+
DEFAULT_TIMEZONE: Final = "UTC"
1819

1920

2021
class LogLevel(StrEnum):
@@ -45,7 +46,7 @@ class RotateWhen(StrEnum):
4546

4647

4748
# Level mapping for performance optimization
48-
LEVEL_MAP = {
49+
LEVEL_MAP: Final = {
4950
LogLevel.DEBUG.value.lower(): logging.DEBUG,
5051
LogLevel.WARNING.value.lower(): logging.WARNING,
5152
LogLevel.WARN.value.lower(): logging.WARNING,

pythonlogs/core/factory.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class LoggerConfig:
2929
maxmbytes: int | None = None
3030
when: RotateWhen | str | None = None
3131
sufix: str | None = None
32-
rotateatutc: bool | None = None
3332
daystokeep: int | None = None
3433

3534

@@ -254,7 +253,6 @@ def get_memory_limits(cls) -> dict[str, int]:
254253
"timezone",
255254
"streamhandler",
256255
"showlocation",
257-
"rotateatutc",
258256
},
259257
),
260258
}
@@ -426,7 +424,6 @@ def __init__(
426424
timezone: str | None = None,
427425
streamhandler: bool | None = None,
428426
showlocation: bool | None = None,
429-
rotateatutc: bool | None = None,
430427
):
431428
self._logger = LoggerFactory.create_logger(
432429
LoggerType.TIMED_ROTATING,
@@ -442,7 +439,6 @@ def __init__(
442439
timezone=timezone,
443440
streamhandler=streamhandler,
444441
showlocation=showlocation,
445-
rotateatutc=rotateatutc,
446442
)
447443
self._name = name or get_log_settings().appname
448444

pythonlogs/core/settings.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ class LogSettings(BaseSettings):
9595
default=RotateWhen.MIDNIGHT,
9696
description="When to rotate log files (midnight, hourly, daily, weekly)",
9797
)
98-
rotate_at_utc: bool = Field(
99-
default=True,
100-
description="Use UTC time for rotation timing",
101-
)
10298
rotate_file_sufix: str = Field(
10399
default=DEFAULT_ROTATE_SUFFIX,
104100
description="Date suffix format for rotated log files",

pythonlogs/timed_rotating.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def __init__(
4343
timezone: str | None = None,
4444
streamhandler: bool | None = None,
4545
showlocation: bool | None = None,
46-
rotateatutc: bool | None = None,
4746
):
4847
_settings = get_log_settings()
4948
self.level = get_level(level or _settings.level)
@@ -58,7 +57,7 @@ def __init__(
5857
self.timezone = timezone or _settings.timezone
5958
self.streamhandler = streamhandler or _settings.stream_handler
6059
self.showlocation = showlocation or _settings.show_location
61-
self.rotateatutc = rotateatutc or _settings.rotate_at_utc
60+
self.rotateatutc = self.timezone.upper() == "UTC"
6261
self.logger = None
6362

6463
def init(self):

0 commit comments

Comments
 (0)