We're using syslog logging everywhere else -- use it here, too.

- Legacy-Id: 6291
This commit is contained in:
Henrik Levkowetz 2013-09-27 17:36:42 +00:00
parent 254d6f70dd
commit 19d4b17e53
2 changed files with 23 additions and 4 deletions

View file

@ -1,4 +1,4 @@
import logging
#import logging
from django.conf import settings
@ -13,7 +13,12 @@ except:
except:
from dajaxice.utils import simple_import_module as import_module
log = logging.getLogger('dajaxice.DajaxiceRequest')
#log = logging.getLogger('dajaxice.DajaxiceRequest')
import syslog
def warning(msg):
syslog.syslog(syslog.LOG_WANRNING, msg)
log = syslog
log.warning = warning
class DajaxiceFunction(object):

View file

@ -33,7 +33,7 @@
import os
import sys
import logging
#import logging
import traceback
from django.conf import settings
@ -43,7 +43,21 @@ from django.http import HttpResponse
from dajaxice.core import dajaxice_functions
from dajaxice.exceptions import FunctionNotCallableError, DajaxiceImportError
log = logging.getLogger('dajaxice.DajaxiceRequest')
#log = logging.getLogger('dajaxice.DajaxiceRequest')
import syslog
def debug(msg):
syslog.syslog(syslog.LOG_DEBUG, msg)
def info(msg):
syslog.syslog(syslog.LOG_INFO, msg)
def warning(msg):
syslog.syslog(syslog.LOG_WANRNING, msg)
def error(msg):
syslog.syslog(syslog.LOG_ERR, msg)
log = syslog
log.debug = debug
log.info = info
log.warning = warning
log.error = error
# Python 2.7 has an importlib with import_module.
# For older Pythons, Django's bundled copy provides it.