Importing all of DRL, including ulogd and all of its files.
[distributedratelimiting.git] / drl / logging.h
diff --git a/drl/logging.h b/drl/logging.h
new file mode 100644 (file)
index 0000000..034614b
--- /dev/null
@@ -0,0 +1,29 @@
+/* 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_ */