We're using syslog logging everywhere else -- use it here, too.
- Legacy-Id: 6291
This commit is contained in:
parent
254d6f70dd
commit
19d4b17e53
dajaxice/core
|
@ -1,4 +1,4 @@
|
||||||
import logging
|
#import logging
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
@ -13,7 +13,12 @@ except:
|
||||||
except:
|
except:
|
||||||
from dajaxice.utils import simple_import_module as import_module
|
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):
|
class DajaxiceFunction(object):
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import logging
|
#import logging
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -43,7 +43,21 @@ from django.http import HttpResponse
|
||||||
from dajaxice.core import dajaxice_functions
|
from dajaxice.core import dajaxice_functions
|
||||||
from dajaxice.exceptions import FunctionNotCallableError, DajaxiceImportError
|
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.
|
# Python 2.7 has an importlib with import_module.
|
||||||
# For older Pythons, Django's bundled copy provides it.
|
# For older Pythons, Django's bundled copy provides it.
|
||||||
|
|
Loading…
Reference in a new issue