JSON logging setup for Python.
Project description
Introduction
Simple package/script to setup JSON logging for a Python app or script. Uses python-json-logger and is mostly just a wrapper around it. Instead of adding this script to every Python module that I/you create you can just add this as a dependency and call:
from nialog import setup_module_logging, LoggingLevel
# Default logging level is WARNING
setup_module_logging()
# LoggingLevel has enums for default logging module levels
# Can be used with e.g. typer as command-line inputs
LoggingLevel.DEBUG.value == "DEBUG" # = True
Running tests
To run pytest in currently installed environment:
poetry run pytest
To run test suite best suited for before pushing to e.g. GitHub.
poetry run invoke prepush
To run full extensive test suite:
poetry run invoke test
Formatting and linting
Formatting and linting is done with a single command. First formats, then lints.
poetry run invoke format-and-lint
Building docs
Docs can be built locally to test that ReadTheDocs can also build them:
poetry run invoke docs
Invoke usage
To list all available commands from tasks.py:
poetry run invoke --list
Development
Development dependencies include:
invoke
nox
copier
pytest
coverage
sphinx
Big thanks to all maintainers of the above packages!
License
Copyright © 2021, Nikolas Ovaskainen.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nialog-0.0.2.tar.gz
.
File metadata
- Download URL: nialog-0.0.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b9e12bcc6b02aa2e894e516b5ef55b32efaa7dd4bd10b35900dace00caaf9c1 |
|
MD5 | 287e64a18c4ae8182bb2b5e9d430d9f0 |
|
BLAKE2b-256 | fe0c2efa387b7b59b8c87787c657f469ce87ec4535481c9c76c49f7e00dd505a |
File details
Details for the file nialog-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: nialog-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef9b71fe7d129912fa8a33236b8a7e51a3bb7ce6e05aa27f2793977b944e0d6b |
|
MD5 | af171831a0dd43ed6e115a1ebc4fae94 |
|
BLAKE2b-256 | 36ab7f1f8f9f019092304fdd04eb0c3fc3884769efea3c1b6082309e2172bb1d |