custom-python-logger 4.0.1__tar.gz → 4.1.0__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.
- {custom_python_logger-4.0.1/custom_python_logger.egg-info → custom_python_logger-4.1.0}/PKG-INFO +2 -2
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/custom_python_logger/consts.py +3 -1
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/custom_python_logger/logger.py +1 -1
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0/custom_python_logger.egg-info}/PKG-INFO +2 -2
- custom_python_logger-4.1.0/custom_python_logger.egg-info/requires.txt +2 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/pyproject.toml +7 -7
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/tests/test_logger_pytest.py +1 -1
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/tests/test_short_path_filter.py +8 -11
- custom_python_logger-4.0.1/custom_python_logger.egg-info/requires.txt +0 -2
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/LICENSE +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/MANIFEST.in +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/README.md +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/custom_python_logger/__init__.py +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/custom_python_logger.egg-info/SOURCES.txt +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/custom_python_logger.egg-info/dependency_links.txt +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/custom_python_logger.egg-info/top_level.txt +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/setup.cfg +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/tests/test_logger.py +0 -0
- {custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/tests/test_usage_example_pytest.py +0 -0
{custom_python_logger-4.0.1/custom_python_logger.egg-info → custom_python_logger-4.1.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: custom-python-logger
|
|
3
|
-
Version: 4.0
|
|
3
|
+
Version: 4.1.0
|
|
4
4
|
Summary: A custom logger with color support and additional features.
|
|
5
5
|
Author: Avi Zaguri
|
|
6
6
|
License: MIT
|
|
@@ -16,7 +16,7 @@ Classifier: Topic :: System :: Logging
|
|
|
16
16
|
Requires-Python: >=3.12
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: colorlog>=6.
|
|
19
|
+
Requires-Dist: colorlog>=6.12.0
|
|
20
20
|
Requires-Dist: pyyaml>=6.0.3
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
2
|
|
|
3
|
-
LOG_FORMAT_FILENAME =
|
|
3
|
+
LOG_FORMAT_FILENAME = (
|
|
4
|
+
"%(asctime)s | %(levelname)-9s | l.%(levelno)s | %(name)s | %(filename)s:%(funcName)s:%(lineno)d | %(message)s"
|
|
5
|
+
)
|
|
4
6
|
LOG_FORMAT_SHORTPATH = (
|
|
5
7
|
"%(asctime)s | %(levelname)-9s | l.%(levelno)s | %(name)s | %(shortpath)s:%(lineno)s | %(message)s"
|
|
6
8
|
)
|
|
@@ -142,7 +142,7 @@ def get_logger(name: str, log_level: int | None = None, extra: dict | None = Non
|
|
|
142
142
|
return new_logger
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
def build_logger(
|
|
145
|
+
def build_logger(
|
|
146
146
|
project_name: str,
|
|
147
147
|
extra: dict[str, Any] | None = None,
|
|
148
148
|
log_format: str = LOG_FORMAT_FILENAME,
|
{custom_python_logger-4.0.1 → custom_python_logger-4.1.0/custom_python_logger.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: custom-python-logger
|
|
3
|
-
Version: 4.0
|
|
3
|
+
Version: 4.1.0
|
|
4
4
|
Summary: A custom logger with color support and additional features.
|
|
5
5
|
Author: Avi Zaguri
|
|
6
6
|
License: MIT
|
|
@@ -16,7 +16,7 @@ Classifier: Topic :: System :: Logging
|
|
|
16
16
|
Requires-Python: >=3.12
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: colorlog>=6.
|
|
19
|
+
Requires-Dist: colorlog>=6.12.0
|
|
20
20
|
Requires-Dist: pyyaml>=6.0.3
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "custom-python-logger"
|
|
7
|
-
version = "4.0
|
|
7
|
+
version = "4.1.0"
|
|
8
8
|
description = "A custom logger with color support and additional features."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -23,17 +23,17 @@ classifiers = [
|
|
|
23
23
|
]
|
|
24
24
|
|
|
25
25
|
dependencies = [
|
|
26
|
-
"colorlog>=6.
|
|
26
|
+
"colorlog>=6.12.0",
|
|
27
27
|
"pyyaml>=6.0.3",
|
|
28
28
|
]
|
|
29
29
|
|
|
30
30
|
[dependency-groups]
|
|
31
31
|
dev = [
|
|
32
|
-
"pre-commit>=4.
|
|
33
|
-
"pytest>=9.
|
|
34
|
-
"python-dotenv>=1.2.
|
|
35
|
-
"setuptools>=
|
|
36
|
-
"wheel>=0.
|
|
32
|
+
"pre-commit>=4.6.2",
|
|
33
|
+
"pytest>=9.1.1",
|
|
34
|
+
"python-dotenv>=1.2.3",
|
|
35
|
+
"setuptools>=84.0.0",
|
|
36
|
+
"wheel>=0.48.0",
|
|
37
37
|
]
|
|
38
38
|
|
|
39
39
|
[project.urls]
|
|
@@ -11,7 +11,7 @@ from custom_python_logger import CustomLoggerAdapter, build_logger, json_pretty_
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
@pytest.fixture
|
|
14
|
-
def temp_log_file() -> Generator[str
|
|
14
|
+
def temp_log_file() -> Generator[str]:
|
|
15
15
|
with tempfile.NamedTemporaryFile(delete=False) as f:
|
|
16
16
|
yield f.name
|
|
17
17
|
os.remove(f.name)
|
|
@@ -7,7 +7,7 @@ from unittest.mock import patch
|
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
9
|
|
|
10
|
-
from custom_python_logger import build_logger
|
|
10
|
+
from custom_python_logger import LOG_FORMAT_SHORTPATH, build_logger
|
|
11
11
|
from custom_python_logger.logger import _ShortPathFilter
|
|
12
12
|
|
|
13
13
|
|
|
@@ -26,7 +26,7 @@ def _make_record(pathname: str, name: str = "custom_logger.test") -> logging.Log
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
@pytest.fixture
|
|
29
|
-
def temp_log_file() -> Generator[str
|
|
29
|
+
def temp_log_file() -> Generator[str]:
|
|
30
30
|
with tempfile.NamedTemporaryFile(delete=False, suffix=".log") as f:
|
|
31
31
|
yield f.name
|
|
32
32
|
os.remove(f.name)
|
|
@@ -55,9 +55,7 @@ class TestShortPathFilterLogic:
|
|
|
55
55
|
assert result is True, "filter() must always return True"
|
|
56
56
|
assert (
|
|
57
57
|
record.shortpath == "my_project/app/main.py"
|
|
58
|
-
),
|
|
59
|
-
f"Expected 'my_project/app/main.py', got '{record.shortpath}'" # pylint: disable=E1101
|
|
60
|
-
)
|
|
58
|
+
), f"Expected 'my_project/app/main.py', got '{record.shortpath}'"
|
|
61
59
|
|
|
62
60
|
def test_project_name_not_in_path_falls_back_to_full_pathname(self) -> None:
|
|
63
61
|
with patch.dict(os.environ, {"PROJECT_NAME": "my_project"}):
|
|
@@ -68,7 +66,7 @@ class TestShortPathFilterLogic:
|
|
|
68
66
|
|
|
69
67
|
assert (
|
|
70
68
|
record.shortpath == "/home/user/other_project/app/main.py"
|
|
71
|
-
), f"Expected full pathname, got '{record.shortpath}'"
|
|
69
|
+
), f"Expected full pathname, got '{record.shortpath}'"
|
|
72
70
|
|
|
73
71
|
def test_no_project_name_env_falls_back_to_full_pathname(self) -> None:
|
|
74
72
|
with patch.dict(os.environ, {}, clear=True):
|
|
@@ -79,7 +77,7 @@ class TestShortPathFilterLogic:
|
|
|
79
77
|
|
|
80
78
|
assert (
|
|
81
79
|
record.shortpath == "/home/user/my_project/app/main.py"
|
|
82
|
-
), f"Expected full pathname, got '{record.shortpath}'"
|
|
80
|
+
), f"Expected full pathname, got '{record.shortpath}'"
|
|
83
81
|
|
|
84
82
|
def test_venv_in_path_sets_venv_relative_shortpath(self) -> None:
|
|
85
83
|
with patch.dict(os.environ, {"PROJECT_NAME": "my_project"}):
|
|
@@ -90,7 +88,7 @@ class TestShortPathFilterLogic:
|
|
|
90
88
|
|
|
91
89
|
assert (
|
|
92
90
|
record.shortpath == ".venv/lib/python3.13/site-packages/urllib3/pool.py"
|
|
93
|
-
), f"Expected .venv-relative path, got '{record.shortpath}'"
|
|
91
|
+
), f"Expected .venv-relative path, got '{record.shortpath}'"
|
|
94
92
|
|
|
95
93
|
def test_venv_takes_precedence_over_project_name(self) -> None:
|
|
96
94
|
with patch.dict(os.environ, {"PROJECT_NAME": "my_project"}):
|
|
@@ -99,9 +97,7 @@ class TestShortPathFilterLogic:
|
|
|
99
97
|
|
|
100
98
|
f.filter(record)
|
|
101
99
|
|
|
102
|
-
assert record.shortpath.startswith(
|
|
103
|
-
".venv/"
|
|
104
|
-
), f"Expected .venv-relative path, got '{record.shortpath}'" # pylint: disable=E1101 # pylint: disable=E1101
|
|
100
|
+
assert record.shortpath.startswith(".venv/"), f"Expected .venv-relative path, got '{record.shortpath}'"
|
|
105
101
|
|
|
106
102
|
def test_filter_always_returns_true(self) -> None:
|
|
107
103
|
with patch.dict(os.environ, {"PROJECT_NAME": "my_project"}):
|
|
@@ -148,6 +144,7 @@ class TestBuildLoggerFilterIntegration:
|
|
|
148
144
|
with patch.dict(os.environ, {"PROJECT_NAME": "custom-python-logger"}):
|
|
149
145
|
logger = build_logger(
|
|
150
146
|
project_name="ShortPathTest",
|
|
147
|
+
log_format=LOG_FORMAT_SHORTPATH,
|
|
151
148
|
log_file=True,
|
|
152
149
|
log_file_path=temp_log_file,
|
|
153
150
|
console_output=False,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/custom_python_logger.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{custom_python_logger-4.0.1 → custom_python_logger-4.1.0}/tests/test_usage_example_pytest.py
RENAMED
|
File without changes
|