X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drl%2Flogging.h;fp=drl%2Flogging.h;h=034614bf0ce9e78c8b37e3c8c386fbc6c32fb8b5;hb=0be9704d6b24d09ebd55beedec52758cb88c570b;hp=0000000000000000000000000000000000000000;hpb=6747e89080a8265aa73320bd9f40a0fa6e1c161e;p=distributedratelimiting.git diff --git a/drl/logging.h b/drl/logging.h new file mode 100644 index 0000000..034614b --- /dev/null +++ b/drl/logging.h @@ -0,0 +1,29 @@ +/* See the DRL-LICENSE file for this file's software license. */ + +#ifndef _LOGGING_H_ +#define _LOGGING_H_ + +#include +#include +#include + +#define LOG_CRITICAL (3) +#define LOG_WARN (2) +#define LOG_DEBUG (1) + +/** + * Logging function. Takes format and arguments similar to printf. + */ +inline void printlog(const uint8_t level, const char *format, ...); + +/** + * Flushes the logfile to disk. + */ +void flushlog(); + +/** + * Returns the log level. + */ +int loglevel(); + +#endif /* _LOGGING_H_ */