# HG changeset patch # User Brian Neal # Date 1244684018 0 # Node ID c14cfd6be87aa7d66f8d4c5c27386af2ceb15fb5 # Parent 91fd31dc78fbc9844e292eb7185c57a62f2bbb62 Added basic logging to settings.py. The send_email function is now logging. Removed remnants of the DebugLog model. diff -r 91fd31dc78fb -r c14cfd6be87a gpp/core/admin.py --- a/gpp/core/admin.py Thu Jun 11 01:00:31 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -"""This file contains the automatic admin site definitions for the core Models""" - -from django.contrib import admin -from core.models import DebugLog - -class DebugLogAdmin(admin.ModelAdmin): - list_display = ('__unicode__', 'level') - ordering = ('-timestamp', ) - date_hierarchy = 'timestamp' - -admin.site.register(DebugLog, DebugLogAdmin) - -# vim: ts=4 sw=4 diff -r 91fd31dc78fb -r c14cfd6be87a gpp/core/functions.py --- a/gpp/core/functions.py Thu Jun 11 01:00:31 2009 +0000 +++ b/gpp/core/functions.py Thu Jun 11 01:33:38 2009 +0000 @@ -16,8 +16,9 @@ django.core.mail.send_mail(subject, message, from_email, recipient_list, fail_silently, auth_user, auth_password) - #logging.info('EMAIL:\nFrom: %s\nTo: %s\nSubject: %s\nMessage:\n%s' % - # (from_email, str(recipient_list), subject, message)) + import logging + logging.debug('EMAIL:\nFrom: %s\nTo: %s\nSubject: %s\nMessage:\n%s' % + (from_email, str(recipient_list), subject, message)) def email_admins(subject, message): diff -r 91fd31dc78fb -r c14cfd6be87a gpp/settings.py --- a/gpp/settings.py Thu Jun 11 01:00:31 2009 +0000 +++ b/gpp/settings.py Thu Jun 11 01:33:38 2009 +0000 @@ -2,8 +2,10 @@ import os import platform +from decimal import Decimal +import logging + import local_settings -from decimal import Decimal project_path = os.path.abspath(os.path.split(__file__)[0]) @@ -157,6 +159,18 @@ DONATIONS_ITEM_NUM = 500 # donation w/name listed DONATIONS_ITEM_ANON_NUM = 501 # donation listed as anonymous +####################################################################### +# Configure Logging +####################################################################### + +logging.basicConfig( + filename=os.path.join(project_path, 'logs', 'gpp.log'), + filemode='a', + format='%(asctime)s %(levelname)s %(message)s', + level=local_settings.LOG_LEVEL) + + +####################################################################### # URL's of 3rd party Javascript and CSS files. # These dictionaries are used by core/templatetags/script_tags, and # should also be used by developers when creating form media classes.