custom-python-logger 2.0.0__tar.gz → 2.0.1__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-2.0.0/custom_python_logger.egg-info → custom_python_logger-2.0.1}/PKG-INFO +1 -1
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger/logger.py +4 -4
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger/usage_example.py +1 -1
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1/custom_python_logger.egg-info}/PKG-INFO +1 -1
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/setup.py +1 -1
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/LICENSE +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/MANIFEST.in +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/README.md +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger/__init__.py +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/SOURCES.txt +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/dependency_links.txt +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/requires.txt +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/top_level.txt +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/pyproject.toml +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/requirements.txt +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/setup.cfg +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/tests/test_logger.py +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/tests/test_logger_pytest.py +0 -0
- {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/tests/test_usage_example_pytest.py +0 -0
|
@@ -109,7 +109,7 @@ def configure_logging(
|
|
|
109
109
|
def build_logger(
|
|
110
110
|
project_name: str,
|
|
111
111
|
extra: Optional[dict[str, Any]] = None,
|
|
112
|
-
log_format: str = "%(asctime)s | %(levelname)-
|
|
112
|
+
log_format: str = "%(asctime)s | %(levelname)-9s | l.%(levelno)s | %(name)s | %(filename)s:%(lineno)s | %(message)s",
|
|
113
113
|
log_level: int = logging.INFO,
|
|
114
114
|
log_file: bool = False,
|
|
115
115
|
log_file_path: str = None,
|
|
@@ -147,7 +147,7 @@ def build_logger(
|
|
|
147
147
|
utc=utc,
|
|
148
148
|
)
|
|
149
149
|
|
|
150
|
-
logger = logging.getLogger()
|
|
150
|
+
logger = logging.getLogger(project_name)
|
|
151
151
|
|
|
152
152
|
if log_level is not None:
|
|
153
153
|
logger.setLevel(log_level)
|
|
@@ -155,8 +155,8 @@ def build_logger(
|
|
|
155
155
|
return CustomLoggerAdapter(logger, extra)
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
def get_logger(name: str) -> CustomLoggerAdapter:
|
|
159
|
-
return CustomLoggerAdapter(logging.getLogger(name),
|
|
158
|
+
def get_logger(name: str, extra: Optional[dict] = None) -> CustomLoggerAdapter:
|
|
159
|
+
return CustomLoggerAdapter(logging.getLogger(name), extra=extra)
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
def json_pretty_format(
|
{custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger/usage_example.py
RENAMED
|
@@ -5,7 +5,7 @@ from custom_python_logger import build_logger, get_logger
|
|
|
5
5
|
|
|
6
6
|
class LoggerTest:
|
|
7
7
|
def __init__(self):
|
|
8
|
-
self.logger = get_logger(self.__class__.__name__)
|
|
8
|
+
self.logger = get_logger(self.__class__.__name__, extra={"class": self.__class__.__name__})
|
|
9
9
|
|
|
10
10
|
def main(self):
|
|
11
11
|
self.logger.debug("Hello World")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/tests/test_usage_example_pytest.py
RENAMED
|
File without changes
|