jonson

out-of-the-box, ready-to-use JSON logger
from jonson import logger
logger.info("Something going as expected", { "host": socket.gethostname() })
logger.warn("Something must have gone terribly wrong")
except Exception as e:
logger.error(e, { description: "something descriptive" })
Log level
Create logger instance with a minimal log level
from jonson import Logger
logger = Logger("warn")
logger.info("Something going as expected", { "host": socket.gethostname() }) # ignored
logger.warn("Something must have gone terribly wrong") # sent
Log levels hirarchy
A few synonyms are available for convenience
trace,verbosedebuginfo,logwarnerrorcritical,fatal,panic
For example, a logger with log level "warn" will only print logs with level "warn", "error", or "critical".
Arguments
Create: Logger class accepts one or two arguments:
{string}Case insensitive name of minimal log level. defaults to"info"{dictionary}{'Key':'Value'} pairs, optional. Persistent enrichment fields for all log records
logger = Logger(os.environ["LOG_LEVEL"], { "host": socket.gethostname() })
Send: Logger functions accept one or two arguments:
{any}Record's "message" field. Traditionally this would be a string or an exception.{dictionary}{'Key':'Value'} pairs, optional. Values should be JSON serializable
logger.info("something, something", { dark: "side" })
Metadata
Release files for jonson 1.1.1
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 |
|---|---|---|---|---|
| jonson-1.1.1.tar.gz | 3.7 kB | Without provenance | Details for jonson-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jonson-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for jonson-1.1.1-py3-none-any.whl |
Total release size: 7.7 kB
Release files / jonson-1.1.1.tar.gz
| Download URL | jonson-1.1.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b523df1568027e8ea6af81c1712532fec8f58ea5b827c924eb2d78a0c4df83b0
|
|
BLAKE2b-256 checksum How to use checksums |
13cae86c2b670e936871f6820aa49642d8043e3c93d7c618f1e3c2ac7c601f3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Release files / jonson-1.1.1-py3-none-any.whl
| Download URL | jonson-1.1.1-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2f99d10216edb972f63358a6ec311d87190d569def39b582e7a68538a9a15df
|
|
BLAKE2b-256 checksum How to use checksums |
d382bf043a863a9c16307a5fccbb55ca17dc595ebe0793009c660be7f3d4f610
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Security for jonson 1.1.1
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.