Mercurial > public > sg101
annotate gpp/core/logging.py @ 11:cc8eb028def1
Update jquery-ui and theme version that is hosted on google. In preparation for having jquery on every page (?), make it so that the autocomplete plug is using the 'global' jquery, and not the one that came with it. It seems to work okay with jquery 1.3.2.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 14 Apr 2009 02:35:35 +0000 |
parents | dbd703f7d63a |
children |
rev | line source |
---|---|
gremmie@1 | 1 '''This module adds a simple logging facility to the portal. |
gremmie@1 | 2 Applications can log information to a database table for debugging. |
gremmie@1 | 3 The logger is similar to the python logging module. |
gremmie@1 | 4 The verbosity of the logging is controlled via settings.GPP_LOG_LEVEL. |
gremmie@1 | 5 ''' |
gremmie@1 | 6 |
gremmie@1 | 7 from settings import GPP_LOG_LEVEL |
gremmie@1 | 8 from core.models import DebugLog |
gremmie@1 | 9 |
gremmie@1 | 10 DEBUG = 10 |
gremmie@1 | 11 INFO = 20 |
gremmie@1 | 12 WARNING = 30 |
gremmie@1 | 13 ERROR = 40 |
gremmie@1 | 14 CRITICAL = 50 |
gremmie@1 | 15 |
gremmie@1 | 16 def log(level, msg): |
gremmie@1 | 17 if GPP_LOG_LEVEL <= level: |
gremmie@1 | 18 log_item = DebugLog() |
gremmie@1 | 19 log_item.level = level |
gremmie@1 | 20 log_item.msg = msg |
gremmie@1 | 21 log_item.save() |
gremmie@1 | 22 |
gremmie@1 | 23 def debug(msg): |
gremmie@1 | 24 log(DEBUG, msg) |
gremmie@1 | 25 |
gremmie@1 | 26 def info(msg): |
gremmie@1 | 27 log(INFO, msg) |
gremmie@1 | 28 |
gremmie@1 | 29 def warning(msg): |
gremmie@1 | 30 log(WARNING, msg) |
gremmie@1 | 31 |
gremmie@1 | 32 def error(msg): |
gremmie@1 | 33 log(WARNING, msg) |
gremmie@1 | 34 |
gremmie@1 | 35 def critical(msg): |
gremmie@1 | 36 log(WARNING, msg) |