|
|
|
@ -1,8 +1,8 @@ |
|
|
|
#define _ISOC99_SOURCE |
|
|
|
|
|
|
|
#include <syslog.h> |
|
|
|
#include <string.h> |
|
|
|
#include <stdio.h> |
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
#include "logger.h" |
|
|
|
|
|
|
|
@ -19,12 +19,14 @@ const int priority[] = { |
|
|
|
|
|
|
|
INIT_CLASS(LOGGER); |
|
|
|
|
|
|
|
static void logger_syslog(int level, const char * msg); |
|
|
|
|
|
|
|
static void |
|
|
|
logger_syslog(int level, const char * msg) |
|
|
|
{ |
|
|
|
syslog(priority[level], "%s", msg); |
|
|
|
} |
|
|
|
|
|
|
|
__construct(LOGGER) |
|
|
|
{ |
|
|
|
memset(this->logfncts, 0, sizeof(this->logfncts)); |
|
|
|
this->logfncts[0] = logger_syslog; |
|
|
|
this->logfncts_count = 1; |
|
|
|
} |
|
|
|
@ -34,12 +36,6 @@ __jsonConst(LOGGER) {} |
|
|
|
__toJson(LOGGER) {} |
|
|
|
__clear(LOGGER) {} |
|
|
|
|
|
|
|
static void |
|
|
|
logger_syslog(int level, const char * msg) |
|
|
|
{ |
|
|
|
syslog(level, "%s", msg); |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
|
logger_log(LOGGER this, int level, const char * message, ...) { |
|
|
|
va_list args; |
|
|
|
@ -58,6 +54,7 @@ logger_log(LOGGER this, int level, const char * message, ...) { |
|
|
|
|
|
|
|
while (NULL != *logfnct) { |
|
|
|
(*logfnct)(level, buffer); |
|
|
|
logfnct++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|