Skip to main content

pylogx

python logging extensions supporting additional levels, colorization, indentation and more

Features

  • Additional log levels (HINT, NOTE, TRACE) for more granularity
  • Colorize log messages based on the log level
  • Indent log messages
  • Log relative time stamps

Documentation

Quickstart

Colorize your log messages

    import time
    import pylogx
    from pylogx import log

    pylogx.enable_colors(level=pylogx.Level.NOTE, ups=[pylogx.Level.NOTE])

    log.trace("Have fun with colorized log messages")
    log.note("This message disappears with the next log message")
    time.sleep(5)
    log.note("Another message disappearing soon..")
    time.sleep(5)
    log.success("Last message is gone")

Indent your log messages

    import logging
    from pylogx import log, Indent

    formatter = logging.Formatter(fmt="%(asctime)s %(indent)s%(message)s")
    sh = logging.StreamHandler()
    sh.setFormatter(formatter)
    log.addHandler(sh)

    indent = Indent(indent=" => ")

    log.info("base level")

    indent.inc()
    log.info("sub level")
    indent.inc()
    log.info("sub sub level")
    indent.dec()
    log.info("sub level")

Print log messages with relative time stamp

    import time
    import logging
    from pylogx import log, PrettyDelta, Level

    pd = PrettyDelta()
    prd = PrettyDelta(name="prettyRelativeDelta", fmt="+%M:%S.%f", relative=True)
    log.addFilter(prd)
    formatter = logging.Formatter(fmt="%(prettyDelta)s [%(prettyRelativeDelta)s] %(message)s")
    sh = logging.StreamHandler()
    sh.setFormatter(formatter)
    log.addHandler(sh)
    log.setLevel(Level.INFO)

    log.warning("enjoy relative timestamps")
    time.sleep(1)
    log.info("enjoy relative timestamps")
    time.sleep(2)
    log.info("enjoy relative timestamps")

Metadata

Release files for pylogx 1.0.3

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

Source distribution (sdist)

Source distribution for pylogx 1.0.3
File Size Uploaded Provenance Actions
pylogx-1.0.3.tar.gz 4.5 kB Without provenance Details for pylogx-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pylogx 1.0.3
File Interpreter ABI Platform Actions
pylogx-1.0.3-py2.py3-none-any.whl Python 2, Python 3 none any Details for pylogx-1.0.3-py2.py3-none-any.whl

Total release size: 9.6 kB

Release files / pylogx-1.0.3.tar.gz

Download URL pylogx-1.0.3.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4d5585f1184eed85345cbb20d6c41a4eb3e1637525e6a390f87a146961e2c028
BLAKE2b-256 checksum
How to use checksums
f074ee30f049caffda60b4123e71a320265484f4f149b21d79718d9c2192069b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.15

Release files / pylogx-1.0.3-py2.py3-none-any.whl

Download URL pylogx-1.0.3-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
30f1caa900db163d0b99525b861ec1ecfdafdcea6949a0db006a62529663dcb5
BLAKE2b-256 checksum
How to use checksums
bc82c225041d5c33a9b45e43ff56d0c6d60c0e8f1148a219a8b50b155fff36c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.15

Security for pylogx 1.0.3

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