Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, program_name=None, facility="user",
formatter=formatter.TEXT_FORMATTER, level=None):
if syslog is None:
# FIXME(jd) raise something more specific
raise RuntimeError("syslog is not available on this platform")
super(Syslog, self).__init__(
handlers.SyslogHandler(
program_name=program_name or get_program_name(),
facility=self._find_facility(facility)),
formatter, level)
def __init__(self, program_name, facility=None):
# Default values always get evaluated, for which reason we avoid
# using 'syslog' directly, which may not be available.
facility = facility if facility is not None else syslog.LOG_USER
if not syslog:
raise RuntimeError("Syslog not available on this platform")
super(SyslogHandler, self).__init__()
syslog.openlog(program_name, 0, facility)