core-legacy/include/logger.h
Tobias Reisinger 01ffb1d58d add: response macros
add: preparation for more macro endpoints
2020-09-05 13:29:46 +02:00

25 lines
1.1 KiB
C

#ifndef EMGAUWA_LOGGER_H
#define EMGAUWA_LOGGER_H
#include <stdio.h>
#include <time.h>
#include <syslog.h>
#include <colors.h>
#include <config.h>
#define LOG_NONE INT_MAX
void
logger_log(int level, const char *filename, int line, const char *func, const char *msg, ...);
#define LOGGER_NONE(...) logger_log(LOG_NONE , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define LOGGER_DEBUG(...) logger_log(LOG_DEBUG , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define LOGGER_INFO(...) logger_log(LOG_INFO , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define LOGGER_NOTICE(...) logger_log(LOG_NOTICE , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define LOGGER_WARNING(...) logger_log(LOG_WARNING, __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define LOGGER_ERR(...) logger_log(LOG_ERR , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define LOGGER_CRIT(...) logger_log(LOG_CRIT , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define LOGGER_EMERG(...) logger_log(LOG_EMERG , __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#endif //EMGAUWA_LOGGER_H