Skip to content

Commit 19d4b17

Browse files
committed
We're using syslog logging everywhere else -- use it here, too.
- Legacy-Id: 6291
1 parent 254d6f7 commit 19d4b17

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

dajaxice/core/Dajaxice.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import logging
1+
#import logging
22

33
from django.conf import settings
44

@@ -13,7 +13,12 @@
1313
except:
1414
from dajaxice.utils import simple_import_module as import_module
1515

16-
log = logging.getLogger('dajaxice.DajaxiceRequest')
16+
#log = logging.getLogger('dajaxice.DajaxiceRequest')
17+
import syslog
18+
def warning(msg):
19+
syslog.syslog(syslog.LOG_WANRNING, msg)
20+
log = syslog
21+
log.warning = warning
1722

1823

1924
class DajaxiceFunction(object):

dajaxice/core/DajaxiceRequest.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
import os
3535
import sys
36-
import logging
36+
#import logging
3737
import traceback
3838

3939
from django.conf import settings
@@ -43,7 +43,21 @@
4343
from dajaxice.core import dajaxice_functions
4444
from dajaxice.exceptions import FunctionNotCallableError, DajaxiceImportError
4545

46-
log = logging.getLogger('dajaxice.DajaxiceRequest')
46+
#log = logging.getLogger('dajaxice.DajaxiceRequest')
47+
import syslog
48+
def debug(msg):
49+
syslog.syslog(syslog.LOG_DEBUG, msg)
50+
def info(msg):
51+
syslog.syslog(syslog.LOG_INFO, msg)
52+
def warning(msg):
53+
syslog.syslog(syslog.LOG_WANRNING, msg)
54+
def error(msg):
55+
syslog.syslog(syslog.LOG_ERR, msg)
56+
log = syslog
57+
log.debug = debug
58+
log.info = info
59+
log.warning = warning
60+
log.error = error
4761

4862
# Python 2.7 has an importlib with import_module.
4963
# For older Pythons, Django's bundled copy provides it.

0 commit comments

Comments
 (0)