Skip to main content

Python logging for humans

Project description

# sanelogging

## Sane defaults for python logging

The python stdlib `logging` module is useful, flexible, and configurable.

However, the maintainers reasonably have determined that python is an
application runtime and not an application. The default configuration
for the `logging` is not very useful, and this results in boilerplate.

This is an opinionated module for the 90% case where you just want sane
defaults. (In effect, moving the boilerplate into PyPI.)

# Other Stuff

There are some convenience methods added, such as `panic` and `die` (c.f.
golang and perl).

`notice` is additionally aliased to `info`, for those who forget that python
doesn't have a notice level (i.e. me).

If you set the environment variable `LOG_TO_SYSLOG`, it will print out your
log messages on paper and mail them to you.

# Usage

from sanelogging import log"starting up!")

log.error("something went wrong.")

log.die("bailing out") # script exits



Jeffrey Paul <([]>




This code is released into the public domain.

Project details

Download files

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

Files for sanelogging, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size sanelogging-1.0.0.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page