Skip to main content

Avacado

Version : 0.2.0 Author : Thomas Weholt <thomas@weholt.org> License : GPL v3.0 WWW : https://bitbucket.org/weholt/django-avacado Status : Experimental/Alpha/Proof-of-concept.

About

Deliciously delayed and cached database logging for django.

FYI: The code is still in early alpha stage of development so beware.

NB! It sorta looks like the std module logger in python, but it’s not. This is that one time that even if it looks like a duck and quacks like a duck, it’s still not a duck.

The code has so far only been tested using SQLite, Django 1.3, Python 2.6.6 on Ubuntu 10.10.

Usage

Avocado is meant to be used when you want to log huge amounts of log entries related to the same context, store the log in the db for easy sorting and viewing, and not have the performance hit of using the django orm.

You might do something like this in your view:

from avocado.context import get_context

with get_context("filescanning") as log:
    for filename in somefilescanningmethod():
        # do something with the file and store some information about it
        log.info("Did something to %s." % filename)

You can also log information and add an instance of a django model. In the admin you can see the log and click to go directly to the related model:

with get_context("UserProcessing") as log:
    for usr in User.objects.all():
        # do something with the user and store some information about it
        log.info("Did something to %s." % user, instance=user)

You can also log exceptions and avocado will try to log more than just the name of the exception being raised, but this not formatted very pretty at the moment and the code seems to bring along a lot of useless info. Still, here’s how to test it:

with get_context("UserProcessing") as log:
    try:
        a = 0
        b = 2
        c = b / a
    except Exception, e:
        log.exception("Math exception: %s" % e)

You don’t have to pass the exception along. Avocado will dig out lots of stuff for you.

Installation

pip install django-avocado

or

hg clone https://bitbucket.org/weholt/django-avacado python setup.py install

Add avocado to INSTALLED_APPS. You might have to copy or symlink to the templates in the avocado-folder, but I don’t think so.

Requirements

  • django

  • dse

Changelog

0.2.0 : Rewrote some to be compatible with the latest release of DSE. 0.1.0 : Initial release.

Metadata

Release files for Django-Avocado 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Django-Avocado 0.2.0
File Size Uploaded Provenance Actions
Django-Avocado-0.2.0.tar.gz 18.1 kB Without provenance Details for Django-Avocado-0.2.0.tar.gz

Release files / Django-Avocado-0.2.0.tar.gz

Download URL Django-Avocado-0.2.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e9370e4862092e1ce9f735e4be4d65b28304043196e05c4413d55dd6297768c1
BLAKE2b-256 checksum
How to use checksums
3d0670ebb4da34d0d63e12c379276c33bb404ad57a0da6d973e1a5061c570b8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Django-Avocado 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page