pythonLogs 4.0.4__tar.gz → 4.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/PKG-INFO +1 -2
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pyproject.toml +1 -2
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/constants.py +13 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/log_utils.py +2 -12
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/LICENSE +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/README.md +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/.env.example +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/__init__.py +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/basic_log.py +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/factory.py +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/memory_utils.py +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/settings.py +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/size_rotating.py +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/thread_safety.py +0 -0
- {pythonlogs-4.0.4 → pythonlogs-4.0.5}/pythonLogs/timed_rotating.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pythonLogs
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.5
|
|
4
4
|
Summary: High-performance Python logging library with file rotation and optimized caching for better performance
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: python3,python-3,python,log,logging,logger,logutils,log-utils,pythonLogs
|
|
@@ -21,7 +21,6 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
22
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
-
Requires-Dist: pydantic (>=2.11.7,<3.0.0)
|
|
25
24
|
Requires-Dist: pydantic-settings (>=2.10.1,<3.0.0)
|
|
26
25
|
Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
|
|
27
26
|
Project-URL: Homepage, https://pypi.org/project/pythonLogs
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "pythonLogs"
|
|
7
|
-
version = "4.0.
|
|
7
|
+
version = "4.0.5"
|
|
8
8
|
description = "High-performance Python logging library with file rotation and optimized caching for better performance"
|
|
9
9
|
license = "MIT"
|
|
10
10
|
readme = "README.md"
|
|
@@ -32,7 +32,6 @@ classifiers = [
|
|
|
32
32
|
|
|
33
33
|
[tool.poetry.dependencies]
|
|
34
34
|
python = "^3.10"
|
|
35
|
-
pydantic = "^2.11.7"
|
|
36
35
|
pydantic-settings = "^2.10.1"
|
|
37
36
|
python-dotenv = "^1.1.1"
|
|
38
37
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
+
import logging
|
|
2
3
|
from enum import Enum
|
|
3
4
|
|
|
4
5
|
# File and Directory Constants
|
|
@@ -40,3 +41,15 @@ class RotateWhen(str, Enum):
|
|
|
40
41
|
SUNDAY = "W6"
|
|
41
42
|
HOURLY = "H"
|
|
42
43
|
DAILY = "D"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Level mapping for performance optimization
|
|
47
|
+
LEVEL_MAP = {
|
|
48
|
+
LogLevel.DEBUG.value.lower(): logging.DEBUG,
|
|
49
|
+
LogLevel.WARNING.value.lower(): logging.WARNING,
|
|
50
|
+
LogLevel.WARN.value.lower(): logging.WARNING,
|
|
51
|
+
LogLevel.ERROR.value.lower(): logging.ERROR,
|
|
52
|
+
LogLevel.CRITICAL.value.lower(): logging.CRITICAL,
|
|
53
|
+
LogLevel.CRIT.value.lower(): logging.CRITICAL,
|
|
54
|
+
LogLevel.INFO.value.lower(): logging.INFO,
|
|
55
|
+
}
|
|
@@ -12,7 +12,7 @@ from functools import lru_cache
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from typing import Callable, Set
|
|
14
14
|
from zoneinfo import ZoneInfo
|
|
15
|
-
from pythonLogs.constants import DEFAULT_FILE_MODE,
|
|
15
|
+
from pythonLogs.constants import DEFAULT_FILE_MODE, LEVEL_MAP
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
# Global cache for checked directories with thread safety and size limits
|
|
@@ -182,17 +182,7 @@ def get_level(level: str) -> int:
|
|
|
182
182
|
write_stderr(f"Unable to get log level. Setting default level to: 'INFO' ({logging.INFO})")
|
|
183
183
|
return logging.INFO
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
LogLevel.DEBUG.value.lower(): logging.DEBUG,
|
|
187
|
-
LogLevel.WARNING.value.lower(): logging.WARNING,
|
|
188
|
-
LogLevel.WARN.value.lower(): logging.WARNING,
|
|
189
|
-
LogLevel.ERROR.value.lower(): logging.ERROR,
|
|
190
|
-
LogLevel.CRITICAL.value.lower(): logging.CRITICAL,
|
|
191
|
-
LogLevel.CRIT.value.lower(): logging.CRITICAL,
|
|
192
|
-
LogLevel.INFO.value.lower(): logging.INFO,
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return level_map.get(level.lower(), logging.INFO)
|
|
185
|
+
return LEVEL_MAP.get(level.lower(), logging.INFO)
|
|
196
186
|
|
|
197
187
|
|
|
198
188
|
def get_log_path(directory: str, filename: str) -> str:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|