Skip to content

Commit cc1f2ee

Browse files
committed
Restructure modules
1 parent cb5c557 commit cc1f2ee

File tree

7 files changed

+57
-50
lines changed

7 files changed

+57
-50
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
v0.1.1-beta (2021-05-29)
2+
++++++++++++++++++++++++
3+
4+
Changes
5+
6+
* Move ``QueueListenerHandler`` under ``handlers`` package.
7+
18
v0.1.0-beta (2021-05-29)
29
++++++++++++++++++++++++
310

README.md

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@ Documentation
1515
-------------
1616
[https://logging-extras.readthedocs.io/en/latest/](https://logging-extras.readthedocs.io/en/latest/)
1717

18-
Distribution
18+
Installation
1919
------------
2020

21-
To create a source and wheel distribution, run:
22-
23-
python -m pip install wheel
24-
python setup.py clean sdist bdist_wheel
25-
26-
It is recommended to use a virtualenv.
21+
Install [logging-extras](https://pypi.org/project/logging-extras/) using pip
2722

28-
Installation
29-
------------
23+
pip install logging-extras
3024

31-
Download the latest binary or source package from github [logging-extras releases](https://github.com/zobayer1/logging-extras/releases)
25+
Alternatively, download the latest binary or source package from [github](https://github.com/zobayer1/logging-extras/releases)
3226

3327
Install wheel package with `pip`:
3428

@@ -42,36 +36,8 @@ Install source package as editable:
4236

4337
Please refer to documentation pages for available modules.
4438

45-
Development
46-
-----------
47-
48-
Additional development and documentation dependencies can be installed using extras. It is recommended to use a virtualenv.
49-
50-
### Use Pre-Commit Hooks
51-
52-
Install pre-commit hooks and dependencies:
53-
54-
pip install -e .[dev]
55-
pre-commit install
56-
pre-commit autoupdate
57-
pre-commit run --all-files
58-
59-
### Run Tests
60-
61-
Run tests from the source with Pytest:
62-
63-
pip install -e .[dev]
64-
pytest -s
65-
66-
### Generate Documentation
67-
68-
Generate documentation from the source with Sphinx:
69-
70-
pip install -e .[docs]
71-
cd docs
72-
mkdir -p _static _templates
73-
make html
74-
python -m http.server --directory build/html
39+
Module Index
40+
============
7541

7642
QueueListenerHandler
7743
--------------------
@@ -100,7 +66,7 @@ handlers:
10066
filename: 'test_logger.log'
10167
formatter: simple
10268
queue_handler:
103-
class: logging_.QueueListenerHandler
69+
class: logging_.handlers.QueueListenerHandler
10470
handlers:
10571
- cfg://handlers.console
10672
- cfg://handlers.file_handler
@@ -141,6 +107,43 @@ logger.error("This is an error log")
141107
logger.critical("This is a critical log")
142108
```
143109

144-
### Sources
110+
Development
111+
-----------
112+
113+
Additional development and documentation dependencies can be installed using extras. It is recommended to use a virtualenv.
114+
115+
### Use Pre-Commit Hooks
116+
117+
Install pre-commit hooks and dependencies:
118+
119+
pip install -e .[dev]
120+
pre-commit install
121+
pre-commit autoupdate
122+
pre-commit run --all-files
123+
124+
### Run Tests
125+
126+
Run tests from the source with Pytest:
127+
128+
pip install -e .[dev]
129+
pytest -s
130+
131+
### Generate Documentation
132+
133+
Generate documentation from the source with Sphinx:
134+
135+
pip install -e .[docs]
136+
cd docs
137+
mkdir -p _static _templates
138+
make html
139+
python -m http.server --directory build/html
140+
141+
### Create Distribution Packages
142+
143+
To create a source and wheel distribution, run:
144+
145+
git clone [email protected]:zobayer1/logging-extras.git
146+
python -m pip install wheel
147+
python setup.py clean sdist bdist_wheel
145148

146-
1. `QueueListenerHandler` was inspired by [Rob Blackbourn's implementation](https://rob-blackbourn.medium.com/how-to-use-python-logging-queuehandler-with-dictconfig-1e8b1284e27a).
149+
**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.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
author = "Zobayer Hasan"
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = "v0.1.0-beta"
26+
release = "v0.1.1-beta"
2727
source_suffix = ".rst"
2828
master_doc = "index"
2929

docs/snippets/logging.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ handlers:
1616
filename: 'test_logger.log'
1717
formatter: simple
1818
queue_handler:
19-
class: logging_.QueueListenerHandler
19+
class: logging_.handlers.QueueListenerHandler
2020
handlers:
2121
- cfg://handlers.console
2222
- cfg://handlers.file_handler

logging_/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
# -*- coding: utf-8 -*-
2-
from logging_.handlers import QueueListenerHandler
3-
4-
_all_ = ["QueueListenerHandler"]

logging_/handlers/queue_listener_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class QueueListenerHandler(QueueHandler):
3232
filename: 'config_test.log'
3333
formatter: simple
3434
queue_handler:
35-
class: logging_.QueueListenerHandler
35+
class: logging_.handlers.QueueListenerHandler
3636
handlers:
3737
- cfg://handlers.console
3838
- cfg://handlers.file_handler

tests/test_logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
filename: 'test_logger.log'
2424
formatter: simple
2525
queue_handler:
26-
class: logging_.QueueListenerHandler
26+
class: logging_.handlers.QueueListenerHandler
2727
handlers:
2828
- cfg://handlers.console
2929
- cfg://handlers.file_handler

0 commit comments

Comments
 (0)