possible fix

This commit is contained in:
2024-03-22 14:02:19 +01:00
parent 0071498122
commit 0fe530c6a2
30 changed files with 22 additions and 156 deletions
+107
View File
@@ -0,0 +1,107 @@
Metadata-Version: 2.1
Name: eh_logging
Version: 0.1.5
Summary: Simple helper to get easier formatted logger from the python logging module
Home-page: https://git.eishausener.dev/Eishausener/eh_logging
Author: Eishausener <code@eishausener.de>
Author-email: code@eishausener.de
License: MIT
Project-URL: issue tracker, https://git.eishausener.dev/Eishausener/eh_logging/issues
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: twine; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: setuptools; extra == "dev"
# eh_logging
> Simple helper to get easier formatted logger from the python logging module
# install
pip install git+https://git.eishausener.dev/Eishausener/eh_logging \
or \
pip install git+https://github.com/Eishausener/eh_logging
# usage
import eh-logging, create a formatted logger and use the logger
```python
# import
import eh_logging as logging
# create formatted logger
formatted_logger = logging.get_formatted_logger(
'formatted_logger',
console=True,
console_level=logging.DEBUG,
file=True,
file_path=r'log\formatted_logger.log',
file_level=logging.DEBUG,
file_backup_count=5,
file_rotate='h',
)
# use the logger
formatted_logger.debug('Example formatted DEBUG Message')
formatted_logger.info('Example formatted INFO Message')
formatted_logger.warning('Example formatted WARNING Message')
formatted_logger.error('Example formatted ERROR Message')
formatted_logger.critical('Example formatted CRITICAL Message')
```
use the decorator with the INFO level
```python
# import
import eh_logging as logging
# set default logger to DEBUG level to see output
logging.set_default_level(logging.DEBUG)
# use logging decorator with default logger
@logging.Decorator.info(arg=True, kwarg=True, return_value=True, decimal_places=1)
def example_function(first_param, second_param, *args, **kwargs):
return first_param, second_param, *args, *kwargs
# execute function
example_function('Hello', 'world', 'test', 'example', hello='world', world='test')
```
use the decorator with own logger
```python
# import
import eh_logging as logging
# create formatted logger
formatted_logger = logging.get_formatted_logger(
'example_decorator_logger',
console=True,
console_level=logging.DEBUG,
file=True,
file_path=r'log\decorator_logger.log',
file_level=logging.DEBUG,
file_backup_count=5,
file_rotate='h',
)
# use logging decorator with custom logger
@logging.Decorator.debug(logger=formatted_logger, arg=True, kwarg=True, return_value=True, decimal_places=1)
def example_function(first_param, second_param, *args, **kwargs):
return first_param, second_param, *args, *kwargs
# execute function
example_function('Hello', 'world', 'test', 'example', hello='world', world='test')
```
+9
View File
@@ -0,0 +1,9 @@
README.md
setup.py
eh_logging/__init__.py
eh_logging.egg-info/PKG-INFO
eh_logging.egg-info/SOURCES.txt
eh_logging.egg-info/dependency_links.txt
eh_logging.egg-info/requires.txt
eh_logging.egg-info/top_level.txt
test/test.py
+1
View File
@@ -0,0 +1 @@
+5
View File
@@ -0,0 +1,5 @@
[dev]
twine
wheel
setuptools
+1
View File
@@ -0,0 +1 @@
eh_logging