You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
643 B
34 lines
643 B
#ifndef __LOGGER_H__
|
|
#define __LOGGER_H__
|
|
|
|
#include <cclass.h>
|
|
|
|
|
|
#define LOGGER_EMERG 0
|
|
#define LOGGER_ALERT 1
|
|
#define LOGGER_CRIT 2
|
|
#define LOGGER_ERR 3
|
|
#define LOGGER_WARNING 4
|
|
#define LOGGER_NOTICE 5
|
|
#define LOGGER_INFO 6
|
|
#define LOGGER_DEBUG 7
|
|
|
|
#define MAX_LOG_FNCTS 10
|
|
|
|
|
|
typedef void (*logger_logfnct)(int level, const char * msg);
|
|
|
|
|
|
CLASS(LOGGER) {
|
|
logger_logfnct logfncts[MAX_LOG_FNCTS];
|
|
unsigned int logfncts_count;
|
|
};
|
|
|
|
void logger_log(LOGGER this, int level, const char * msg, ...)
|
|
__attribute__((format (printf, 3, 4)));
|
|
|
|
void logger_add(LOGGER this, logger_logfnct logfunc);
|
|
|
|
#endif /* __LOGGER_H__ */
|
|
|
|
// vim: set ts=4 sw=4:
|