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!

Simple, Django-ready (but can be used without Django as well) logger using excellent logging module.

Project Description

Introduction

Djalog provides ready-to-use logger. This is very simple logging wrapper, if you are looking for something more decent try django-logging.

Installation

In order to install Djalog you may use pip:

pip install Djalog

… or setuptools, if you prefer:

easy_install Djalog

Note that Djalog requires logging module which is available from Python 2.3.

Usage

If you want to quickly check how djalog works, go into your favorite python shell and type:

import djalog
import logging

logging.debug("Log some debug information.")
logging.info("Log some information.")
logging.warn("Log some warning.")
logging.error("Log some error.")
logging.critical("Log some critical information.")

from djalog import configure
configure(LOG_USE_COLORS=True, LOG_SQL=True, LOG_LEVEL=5)

logging.debug("Log some debug information.")
logging.info("Log some information.")
logging.warn("Log some warning.")
logging.error("Log some error.")
logging.critical("Log some critical information.")

# Log sql query
logging.sql("SELECT * FROM users WHERE username = 'admin'")

From this example you can see that changing settings for djalog utility can be done with djalog.configure method.

How does it work

Djalog is simplest possible approach for Django logging. In fact, it can be easily used outside of the Django context (see example at the Usage section).

Warning

Djalog is simple but in some cases it uses internal mechanisms of the logging module which may not always be desirable. For example it switches logging.root logger with djalog.loggers.DjalogLogger or if LOG_SQL is set to True (see DjalogSql) there will be added simple sql method to the logging module.

References

Release History

Release History

This version
History Node

0.9.4

History Node

0.9.3

History Node

0.9.2.stable

History Node

0.9.2

History Node

0.9.1.stable

History Node

0.9.0.stable

History Node

0.8.4.beta

History Node

0.8.3.beta

History Node

0.8.2.beta

History Node

0.8.1.beta

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Djalog-0.9.4.tar.gz (7.4 kB) Copy SHA256 Checksum SHA256 Source May 24, 2010

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