Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Logging in YAML format

Project Description

Yamlog uses a rotating file that rollovers at 128 KB, it writes messages in YAML format since it’s more easy to parse –using the international format for date and time–, and it also logs the higher-level messages to the standard error into single lines.

To setup the logging:

import yamlog
yamlog.setup(filename)

where filename is the file where is going to be logged; /tmp/python.log by default.

And to tear down it:

yamlog.teardown()

Then, in each module where is going to be used, there is to add:

import yamlog
_log = yamlog.logger(__name__)

so it passes the module name where it’s being run. Now, can be used the logging methods –debug(), info(), warning(), error(), critical()– to indicate the importance of a logged message.

Change history

v0.9, 2010-02-12

  • Initial release.
Release History

Release History

This version
History Node

0.9

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting