예제 #1
0
def syslog(arg1, arg2=None):
    if arg2 is not None:
        priority, message = arg1, arg2
    else:
        priority, message = LOG_INFO, arg1
    # if log is not opened, open it now
    if not _S_log_open:
        openlog()
    lib.syslog(priority, "%s", message)
예제 #2
0
def syslog(arg1, arg2=None):
    if arg2 is not None:
        priority, message = arg1, arg2
    else:
        priority, message = LOG_INFO, arg1
    # if log is not opened, open it now
    if not _S_log_open:
        openlog()
    lib.syslog(priority, "%s", message)
예제 #3
0
def syslog(arg1, arg2=None):
    if arg2 is not None:
        priority, message = arg1, arg2
    else:
        priority, message = LOG_INFO, arg1
    # if log is not opened, open it now
    if not _S_log_open:
        openlog()
    if isinstance(message, unicode):
        message = str(message)
    lib.syslog(priority, "%s", message)
예제 #4
0
파일: syslog.py 프로젝트: mozillazg/pypy
def syslog(arg1, arg2=None):
    if arg2 is not None:
        priority, message = arg1, arg2
    else:
        priority, message = LOG_INFO, arg1
    # if log is not opened, open it now
    if not _S_log_open:
        openlog()
    if isinstance(message, unicode):
        message = str(message)
    lib.syslog(priority, "%s", message)
예제 #5
0
파일: syslog.py 프로젝트: Qointum/pypy
def syslog(arg1, arg2=None):
    if arg2 is not None:
        priority, message = arg1, arg2
    else:
        priority, message = LOG_INFO, arg1
    # if log is not opened, open it now
    if not _S_log_open:
        openlog()
    if not isinstance(message, str):
        raise TypeError("syslog() message must be a str, not {!r}".format(type(message).__name__))
    message = message.encode(sys.getdefaultencoding())
    lib.syslog(priority, b"%s", message)
def syslog(arg1, arg2=None):
    if arg2 is not None:
        priority, message = arg1, arg2
    else:
        priority, message = LOG_INFO, arg1
    # if log is not opened, open it now
    if not _S_log_open:
        openlog()
    if not isinstance(message, str):
        raise TypeError("syslog() message must be a str, not {!r}".format(
            type(message).__name__))
    message = message.encode(sys.getdefaultencoding())
    lib.syslog(priority, b"%s", message)