Skip to main content

Introspect and display the logger tree inside "logging"

Project description

This package introspects the logging logger tree in the Standard Library.

While you can write programs that call this package’s tree() function and examine the hierarchy of logger objects that it finds inside of the Standard Library logging module, the simplest use of this package for debugging is to call printout() to print the loggers, filters, and handlers that your application has configured:

>>> logging.getLogger('a')
>>> logging.getLogger('a.b').setLevel(logging.DEBUG)
>>> logging.getLogger('x.c')
>>> from logging_tree import printout
>>> printout()
    ""
    Level WARNING
    |
    o<--"a"
    |   |
    |   o<--"a.b"
    |       Level DEBUG
    |
    o<--[x]
        |
        o<--"x.c"

The logger tree should always print successfully, no matter how complicated. A node whose [name] is in square brackets is a “place holder” that has never actually been named in a getLogger() call. At the moment handlers and filters are not printed out in a terribly informative manner, but this will improve as I continue to code.

I owe great thanks to Rover Apps for letting me release this. I developed the core logic that powers this package on their time, but they are letting me retain the copyright and distribute it to the community!

This package is still under construction and under-documented, but even this primitive release will hopefully help a few of you. I welcome contributions and ideas as this package matures! You can find the bug tracker at the repository page on github. Developers can run this package’s tests with:

$ python -m unittest discover logging_tree

On older versions of Python you will instead have to install unittest2 and use its unit2 command line tool to run the tests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logging_tree-0.5.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file logging_tree-0.5.tar.gz.

File metadata

  • Download URL: logging_tree-0.5.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for logging_tree-0.5.tar.gz
Algorithm Hash digest
SHA256 b3712f3e7e9907c8a072b140bc8a30de7b403dd2d75720bc665ce3ddaed2d4ed
MD5 daba7d6bc3438dff5a3ca35b2bd3b9dc
BLAKE2b-256 6d31f08c175e6270ec526312b6e6f64a895ca9ade141876a893b6916bdd36298

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page