Skip to main content

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).

References

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

Djalog-0.9.3.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file Djalog-0.9.3.tar.gz.

File metadata

  • Download URL: Djalog-0.9.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Djalog-0.9.3.tar.gz
Algorithm Hash digest
SHA256 bfae28571958695916fe6bad79c5f2835df3ae7d31a73cdc04d6b656e301bb83
MD5 0e5cf1bc5fd9b7718332a61d2f82d888
BLAKE2b-256 8ebdab35df80bb4824b0425a7db31aa93eacff24776656822a286f2527c9fe86

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