Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)