custom-python-logger 0.1.1__tar.gz → 0.1.2__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 (16) hide show
  1. {custom_python_logger-0.1.1/custom_python_logger.egg-info → custom_python_logger-0.1.2}/PKG-INFO +1 -1
  2. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/custom_python_logger/logger.py +7 -11
  3. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2/custom_python_logger.egg-info}/PKG-INFO +1 -1
  4. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/setup.py +1 -1
  5. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/LICENSE +0 -0
  6. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/MANIFEST.in +0 -0
  7. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/README.md +0 -0
  8. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/custom_python_logger/__init__.py +0 -0
  9. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/custom_python_logger/usage_example.py +0 -0
  10. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/custom_python_logger.egg-info/SOURCES.txt +0 -0
  11. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/custom_python_logger.egg-info/dependency_links.txt +0 -0
  12. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/custom_python_logger.egg-info/requires.txt +0 -0
  13. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/custom_python_logger.egg-info/top_level.txt +0 -0
  14. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/pyproject.toml +0 -0
  15. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/setup.cfg +0 -0
  16. {custom_python_logger-0.1.1 → custom_python_logger-0.1.2}/tests/test_logger.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: custom-python-logger
3
- Version: 0.1.1
3
+ Version: 0.1.2
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
@@ -9,17 +9,10 @@ from typing import Optional, Any
9
9
  from colorlog import ColoredFormatter
10
10
 
11
11
 
12
- def get_project_path(project_name: str) -> str:
13
- current_path = Path(__file__).parent
14
- while current_path != current_path.parent:
15
- if str(current_path).endswith(f'/{project_name}'):
16
- return str(current_path)
17
- current_path = current_path.parent
18
- raise FileNotFoundError(
19
- f'Project "{project_name}" not found in any parent directories.\n'
20
- f'Current path: {Path(__file__)}',
21
- )
22
-
12
+ def get_root_project_path() -> Path:
13
+ if 'venv' in str(Path(__file__)):
14
+ return Path(__file__).parents[5]
15
+ return Path(__file__).parent
23
16
 
24
17
  def print_before_logger(project_name: str) -> None:
25
18
  main_string = f'Start "{project_name}" Process'
@@ -133,6 +126,9 @@ def get_logger(
133
126
  """
134
127
  print_before_logger(project_name=project_name)
135
128
 
129
+ if not log_file:
130
+ log_file = f'{get_root_project_path()}/logs/{project_name}.log'
131
+
136
132
  configure_logging(
137
133
  log_level=logging.DEBUG,
138
134
  log_format=log_format,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: custom-python-logger
3
- Version: 0.1.1
3
+ Version: 0.1.2
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
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='custom-python-logger',
5
- version='0.1.1',
5
+ version='0.1.2',
6
6
  packages=find_packages(include=['custom_python_logger', 'custom_python_logger.*']),
7
7
  install_requires=[
8
8
  'colorlog>=4.0.0',