Skip to main content

Logging convenience routines.

Project description

The logging package is very useful, but a little painful to use. This package provides low impact logging setup and some extremely useful if unconventional context hooks for logging.

The logging verbosity output format has different defaults based on whether an output log file is a tty and whether the environment variable $DEBUG is set, and to what.

On terminals warnings and errors get ANSI colouring.

A mode is available that uses cs.upd.

Some examples:

Program initialisation:

from cs.logutils import setup_logging

def main(argv):
  cmd = os.path.basename(argv.pop(0))
  setup_logging(cmd)

Basic logging from anywhere:

from cs.logutils import info, warning, error
[...]
def some_function(...):
  [...]
  error("nastiness found! bad value=%r", bad_value)

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

cs.logutils-20171030.tar.gz (7.6 kB view details)

Uploaded Source

File details

Details for the file cs.logutils-20171030.tar.gz.

File metadata

File hashes

Hashes for cs.logutils-20171030.tar.gz
Algorithm Hash digest
SHA256 068c3557c224ec2949defbd4556f0e3dc1e90efb27c8b3d1eb60849e102df6e9
MD5 6621eff2e2a3527fbda0f6eb32ee74fd
BLAKE2b-256 5b05140ca9a889b0f7b84e50b6b470ae71be94c8b960fb40545c43727a3b0b07

See more details on using hashes here.

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