Server 0.0.1
HTTP/REST server implementation

src/logger/syslog.c

Go to the documentation of this file.
00001 
00023 #include <syslog.h>
00024 
00025 #include "logger/logger.h"
00026 #include "logger/interface/logger.h"
00027 
00028 static
00029 const
00030 int syslog_priority[] = {
00031     LOG_USER | LOG_DEBUG,
00032     LOG_USER | LOG_INFO,
00033     LOG_USER | LOG_NOTICE,
00034     LOG_USER | LOG_WARNING,
00035     LOG_USER | LOG_ERR,
00036     LOG_USER | LOG_CRIT,
00037     LOG_USER | LOG_ALERT,
00038     LOG_USER | LOG_EMERG
00039 };
00040 
00041 static
00042 void
00043 logSyslog(void * this, logger_level level, const char * const msg)
00044 {
00045     syslog(syslog_priority[level], "[%s] %s", logger_level_str[level], msg);
00046 }
00047 
00048 INIT_IFACE(Logger, logSyslog);
00049 CREATE_CLASS(LoggerSyslog, Logger, IFACE(Logger));
00050 
00051 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines