Djalog

Simple logging module for Django application
Download

Djalog Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Lukasz Balcerzak
  • Publisher web site:
  • http://code.google.com/u/LukaszBalcerzak/

Djalog Tags


Djalog Description

Simple logging module for Django application Djalog provides ready-to-use logger. It is a very simple logging wrapper, if you are looking for something more decent try this http://code.google.com/p/django-logging/.Installation:In order to install Djalog you may use setuptools:easy_install DjalogYou may also use the most recent version by running those commands:hg clone https://djalog.googlecode.com/hg/ djalogcd djalogpython setup.py installNOTE - You will need mercurial as it is used as version control system for this project.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 djalogimport logginglogging.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 configureconfigure(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 querylogging.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. See DjalogSettings for full list of available variables settings.How does it workDjalog 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). In order to use it with django refer to DjalogDjango.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. Requirements: · Django · Python


Djalog Related Software