Example #1
0
zt_log_ty *
zt_log_syslog2(int opt, int facility) {
#if HAVE_SYSLOG
    char * name    = zt_progname(0, 0);
    int    sysopts = 0;

    if (opt & ZT_LOG_WITH_PID) {
        sysopts |= LOG_PID;
    }
    openlog(name ? name : "Set name with progname call", sysopts, facility);
    return zt_log_new(&vtbl, 0);
#else /* if HAVE_SYSLOG */
    zt_log_ty * logger = zt_log_stderr(ZT_LOG_EMU_SYSLOG);

    zt_log_printf(zt_log_crit, "Syslog not supported on this platform: falling back to zt_log_stderr");
    return logger;
#endif /* HAVE_SYSLOG */
}
Example #2
0
zt_log_ty *
zt_log_stderr(unsigned int opts)
{
    return zt_log_new(&vtbl, opts);
}