Remove dependency on syslog module -- it won't be available under Python 2.7 under Windows.
- Legacy-Id: 4974
This commit is contained in:
parent
de5da28101
commit
8aa4922978
|
@ -5,8 +5,11 @@
|
|||
# http://code.djangoproject.com/wiki/SplitSettings
|
||||
|
||||
import os
|
||||
import syslog
|
||||
syslog.openlog("datatracker", syslog.LOG_PID, syslog.LOG_USER)
|
||||
try:
|
||||
import syslog
|
||||
syslog.openlog("datatracker", syslog.LOG_PID, syslog.LOG_USER)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
# Copyright The IETF Trust 2007, All Rights Reserved
|
||||
|
||||
import syslog
|
||||
try:
|
||||
import syslog
|
||||
write = syslog.syslog
|
||||
except ImportError: # import syslog will fail on Windows boxes
|
||||
import sys
|
||||
write = lambda x: sys.stderr.write(x+"\n")
|
||||
|
||||
import inspect
|
||||
import os.path
|
||||
import ietf
|
||||
|
@ -33,6 +39,6 @@ def log(msg):
|
|||
where = " in " + func + "()"
|
||||
except IndexError:
|
||||
file, line, where = "/<UNKNOWN>", 0, ""
|
||||
syslog.syslog("ietf%s(%d)%s: %s" % (file, line, where, msg))
|
||||
write("ietf%s(%d)%s: %s" % (file, line, where, msg))
|
||||
|
||||
log("IETFdb v%s started" % ietf.__version__)
|
||||
|
|
Loading…
Reference in a new issue