+/* See the DRL-LICENSE file for this file's software license. */
+
+#ifndef _LOGGING_H_
+#define _LOGGING_H_
+
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#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_ */