-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
57 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,20 +15,14 @@ Documentation | |
------------- | ||
[https://logging-extras.readthedocs.io/en/latest/](https://logging-extras.readthedocs.io/en/latest/) | ||
|
||
Distribution | ||
Installation | ||
------------ | ||
|
||
To create a source and wheel distribution, run: | ||
|
||
python -m pip install wheel | ||
python setup.py clean sdist bdist_wheel | ||
|
||
It is recommended to use a virtualenv. | ||
Install [logging-extras](https://pypi.org/project/logging-extras/) using pip | ||
|
||
Installation | ||
------------ | ||
pip install logging-extras | ||
|
||
Download the latest binary or source package from github [logging-extras releases](https://github.com/zobayer1/logging-extras/releases) | ||
Alternatively, download the latest binary or source package from [github](https://github.com/zobayer1/logging-extras/releases) | ||
|
||
Install wheel package with `pip`: | ||
|
||
|
@@ -42,36 +36,8 @@ Install source package as editable: | |
|
||
Please refer to documentation pages for available modules. | ||
|
||
Development | ||
----------- | ||
|
||
Additional development and documentation dependencies can be installed using extras. It is recommended to use a virtualenv. | ||
|
||
### Use Pre-Commit Hooks | ||
|
||
Install pre-commit hooks and dependencies: | ||
|
||
pip install -e .[dev] | ||
pre-commit install | ||
pre-commit autoupdate | ||
pre-commit run --all-files | ||
|
||
### Run Tests | ||
|
||
Run tests from the source with Pytest: | ||
|
||
pip install -e .[dev] | ||
pytest -s | ||
|
||
### Generate Documentation | ||
|
||
Generate documentation from the source with Sphinx: | ||
|
||
pip install -e .[docs] | ||
cd docs | ||
mkdir -p _static _templates | ||
make html | ||
python -m http.server --directory build/html | ||
Module Index | ||
============ | ||
|
||
QueueListenerHandler | ||
-------------------- | ||
|
@@ -100,7 +66,7 @@ handlers: | |
filename: 'test_logger.log' | ||
formatter: simple | ||
queue_handler: | ||
class: logging_.QueueListenerHandler | ||
class: logging_.handlers.QueueListenerHandler | ||
handlers: | ||
- cfg://handlers.console | ||
- cfg://handlers.file_handler | ||
|
@@ -141,6 +107,43 @@ logger.error("This is an error log") | |
logger.critical("This is a critical log") | ||
``` | ||
|
||
### Sources | ||
Development | ||
----------- | ||
|
||
Additional development and documentation dependencies can be installed using extras. It is recommended to use a virtualenv. | ||
|
||
### Use Pre-Commit Hooks | ||
|
||
Install pre-commit hooks and dependencies: | ||
|
||
pip install -e .[dev] | ||
pre-commit install | ||
pre-commit autoupdate | ||
pre-commit run --all-files | ||
|
||
### Run Tests | ||
|
||
Run tests from the source with Pytest: | ||
|
||
pip install -e .[dev] | ||
pytest -s | ||
|
||
### Generate Documentation | ||
|
||
Generate documentation from the source with Sphinx: | ||
|
||
pip install -e .[docs] | ||
cd docs | ||
mkdir -p _static _templates | ||
make html | ||
python -m http.server --directory build/html | ||
|
||
### Create Distribution Packages | ||
|
||
To create a source and wheel distribution, run: | ||
|
||
git clone [email protected]:zobayer1/logging-extras.git | ||
python -m pip install wheel | ||
python setup.py clean sdist bdist_wheel | ||
|
||
1. `QueueListenerHandler` was inspired by [Rob Blackbourn's implementation](https://rob-blackbourn.medium.com/how-to-use-python-logging-queuehandler-with-dictconfig-1e8b1284e27a). | ||
**Note:** This project uses `setuptools-scm` to generate build versions from git tags. Build system will raise errors if you are trying to build packages outside a git repo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
# -*- coding: utf-8 -*- | ||
from logging_.handlers import QueueListenerHandler | ||
|
||
_all_ = ["QueueListenerHandler"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters