Skip to main content

simplestructlogs

A simple wrapper around the python standard logging library that supports structured logs.

JSON logs are supported out of the box, but you can write your own log record classes to support other formats!

Example Usage

from simplestructlogs import StructuredLogger
import logging

def raise_err():
    raise Exception("BOOM")

if __name__ == "__main__":
    logger = StructuredLogger.get_default_logger("calvin", logging.DEBUG, {"parent-context": "This is cool!"})
    logger.debug("debug test")
    child_logger = logger.make_child_context_logger("calvin-child", {"child-context": "woo hoo!"})
    err = KeyError("uh oh")
    child_logger.info("an error", exc_info=err, stack_info=True, extra={"value1": 123, "value2": {"value3" :"456"}})
    try:
        raise_err()
    except Exception as e:
        logger.exception("testing exception logging")
        logger.warn("test with warning", exc_info=e)
        logger.warn("test with warning", is_exception_call=True)

Metadata

Release files for simplestructlogs 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplestructlogs 0.0.4
File Size Uploaded Provenance Actions
simplestructlogs-0.0.4.tar.gz 5.3 kB Without provenance Details for simplestructlogs-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simplestructlogs 0.0.4
File Interpreter ABI Platform Actions
simplestructlogs-0.0.4-py3-none-any.whl Python 3 none any Details for simplestructlogs-0.0.4-py3-none-any.whl

Total release size: 12.0 kB

Release files / simplestructlogs-0.0.4.tar.gz

Download URL simplestructlogs-0.0.4.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b2dbb75b157d46028f0da42a0eb97aed488ff96e05f34a2597237982f643537a
BLAKE2b-256 checksum
How to use checksums
25d9773751cef6c306d6f15a3268bf1005a7004f1e3decf443f915be5862d254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / simplestructlogs-0.0.4-py3-none-any.whl

Download URL simplestructlogs-0.0.4-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e27d6638580292975302be220378aaf5e72f2eb0c67db05e26555fb5b82f7d1
BLAKE2b-256 checksum
How to use checksums
36914e864ce834109409a0120fffa3da276b90775026214ab0b58cb9b37f0663
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Security for simplestructlogs 0.0.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page