server 0.0.1
basicserverinfrastructure

src/logger/syslog.c

Go to the documentation of this file.
00001 #include <syslog.h>
00002 
00003 #include "logger.h"
00004 #include "interface/logger.h"
00005 
00006 static
00007 const
00008 int syslog_priority[] = {
00009     LOG_USER | LOG_DEBUG,
00010     LOG_USER | LOG_INFO,
00011     LOG_USER | LOG_NOTICE,
00012     LOG_USER | LOG_WARNING,
00013     LOG_USER | LOG_ERR,
00014     LOG_USER | LOG_CRIT,
00015     LOG_USER | LOG_ALERT,
00016     LOG_USER | LOG_EMERG
00017 };
00018 
00019 static
00020 void
00021 logSyslog(void * this, logger_level level, const char * const msg)
00022 {
00023     syslog(syslog_priority[level], "[%s] %s", logger_level_str[level], msg);
00024 }
00025 
00026 INIT_IFACE(Logger, logSyslog);
00027 CREATE_CLASS(LoggerSyslog, Logger, IFACE(Logger));
00028 
00029 // vim: set ts=4 sw=4:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines