Example #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)
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)
Example #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)
Example #4
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)
Example #5
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 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)