2020-02-20 20:59:46 +01:00
|
|
|
#ifndef LOGGER_H
|
|
|
|
#define LOGGER_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2021-03-03 10:29:56 +01:00
|
|
|
#define DEFAULT_LOGLEVEL ERROR
|
|
|
|
|
2020-03-13 17:43:24 +01:00
|
|
|
enum LOGLEVEL { QUIET, ERROR, WARN, INFO, DEBUG, TRACE };
|
2020-02-20 20:59:46 +01:00
|
|
|
|
2020-03-13 17:43:24 +01:00
|
|
|
struct logger_properties {
|
2020-02-20 20:59:46 +01:00
|
|
|
enum LOGLEVEL level;
|
2020-03-13 17:43:24 +01:00
|
|
|
FILE *dst;
|
2020-02-20 20:59:46 +01:00
|
|
|
};
|
|
|
|
|
2020-03-13 17:43:24 +01:00
|
|
|
void init_logger(FILE *dst, enum LOGLEVEL level);
|
2020-02-20 20:59:46 +01:00
|
|
|
enum LOGLEVEL get_loglevel(const char *level);
|
|
|
|
void logprint(enum LOGLEVEL level, char *msg, ...);
|
|
|
|
|
|
|
|
#endif
|