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.
Files changed (19) hide show
  1. {custom_python_logger-2.0.0/custom_python_logger.egg-info → custom_python_logger-2.0.1}/PKG-INFO +1 -1
  2. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger/logger.py +4 -4
  3. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger/usage_example.py +1 -1
  4. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1/custom_python_logger.egg-info}/PKG-INFO +1 -1
  5. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/setup.py +1 -1
  6. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/LICENSE +0 -0
  7. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/MANIFEST.in +0 -0
  8. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/README.md +0 -0
  9. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger/__init__.py +0 -0
  10. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/SOURCES.txt +0 -0
  11. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/dependency_links.txt +0 -0
  12. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/requires.txt +0 -0
  13. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/custom_python_logger.egg-info/top_level.txt +0 -0
  14. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/pyproject.toml +0 -0
  15. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/requirements.txt +0 -0
  16. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/setup.cfg +0 -0
  17. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/tests/test_logger.py +0 -0
  18. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/tests/test_logger_pytest.py +0 -0
  19. {custom_python_logger-2.0.0 → custom_python_logger-2.0.1}/tests/test_usage_example_pytest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: custom-python-logger
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: A custom logger with color support and additional features.
5
5
  Home-page: https://github.com/aviz92/custom-python-logger
6
6
  Author: Avi Zaguri
@@ -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)-10s(l.%(levelno)s) | %(name)s | %(filename)s:%(lineno)s | %(message)s",
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(
@@ -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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: custom-python-logger
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: A custom logger with color support and additional features.
5
5
  Home-page: https://github.com/aviz92/custom-python-logger
6
6
  Author: Avi Zaguri
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- package_version = '2.0.0'
3
+ package_version = '2.0.1'
4
4
 
5
5
  package_name = 'custom-python-logger'
6
6
  package_description = 'A custom logger with color support and additional features.'