2020-02-20 20:59:46 +01:00
|
|
|
#ifndef LOGGER_H
|
|
|
|
#define LOGGER_H
|
|
|
|
|
2020-03-13 17:43:24 +01:00
|
|
|
#include <stdarg.h>
|
2020-02-20 20:59:46 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
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
|