loguricorn
This package provides a compatible interface for automatically routing
gunicorn logs to the popular loguru library.
Usage
Install the package:
pip install loguricorn
Then pass the custom interface to gunicorn at runtime:
gunicorn --logger-class loguricorn.Logger tests.app:app
All log records will now be routed through the default loguru.logger.
Configuration
It's possible to customize the loguru.logger instance before gunicorn
initializes itself. Simply add your changes in a configuration file and pass it
to gunicorn at runtime:
import sys
from loguru import logger
logger.remove()
logger.add(
sys.stderr,
colorize=True,
format="<green>{time}</green> <level>{message}</level>",
)
gunicorn -c conf.py --logger-class loguricorn.Logger tests.app:app
It's recommended to import any customizations from your main application and use them in the configuration in order to obtain a consistent log record format across the entire execution.
Testing
Testing is done by starting gunicorn in a subprocess with the custom logger
enabled and validating that the emitted logs match the expected format.
Install dev dependencies:
poetry install
Run test:
poetry run tox .
Contributing
Check out the issues for items needing attention or submit your own and then:
- Fork the repo
- Create your feature branch (git checkout -b feature/fooBar)
- Commit your changes (git commit -am 'Add some fooBar')
- Push to the branch (git push origin feature/fooBar)
- Create a new Pull Request
Metadata
Release files for loguricorn 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| loguricorn-0.1.0.tar.gz | 3.8 kB | Without provenance | Details for loguricorn-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| loguricorn-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for loguricorn-0.1.0-py3-none-any.whl |
Total release size: 7.9 kB
Release files / loguricorn-0.1.0.tar.gz
| Download URL | loguricorn-0.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ecf5d5f32d8443ba1462715cd1a119553e8fb67d1f42c33105a43cc05973458
|
|
BLAKE2b-256 checksum How to use checksums |
ab4c329c7734b65123f11544deb37a3c57bb01bdb104e13df2db5cbfb4c6749f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Release files / loguricorn-0.1.0-py3-none-any.whl
| Download URL | loguricorn-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6a6a8c7c8f314a386dfe8caab4ae12b9754db71a9dcdfd9d70e04adf52fa336
|
|
BLAKE2b-256 checksum How to use checksums |
ede96e69c24348996c2ca72c30b45f8068c3bfbf30880762155afce2960a8f59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Security for loguricorn 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.