custom-python-logger 0.1.1__tar.gz → 0.1.3__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-0.1.1/custom_python_logger.egg-info → custom_python_logger-0.1.3}/PKG-INFO +1 -1
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger/logger.py +8 -11
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3/custom_python_logger.egg-info}/PKG-INFO +1 -1
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/setup.py +1 -1
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/LICENSE +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/MANIFEST.in +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/README.md +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger/__init__.py +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger/usage_example.py +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger.egg-info/SOURCES.txt +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger.egg-info/dependency_links.txt +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger.egg-info/requires.txt +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger.egg-info/top_level.txt +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/pyproject.toml +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/setup.cfg +0 -0
- {custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/tests/test_logger.py +0 -0
|
@@ -9,17 +9,10 @@ from typing import Optional, Any
|
|
|
9
9
|
from colorlog import ColoredFormatter
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
def
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,10 @@ 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
|
+
log_file = log_file.lower().replace(' ', '_')
|
|
132
|
+
|
|
136
133
|
configure_logging(
|
|
137
134
|
log_level=logging.DEBUG,
|
|
138
135
|
log_format=log_format,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger/usage_example.py
RENAMED
|
File without changes
|
{custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{custom_python_logger-0.1.1 → custom_python_logger-0.1.3}/custom_python_logger.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|