]> git.sesse.net Git - cubemap/blobdiff - log.h
Implement much better logging, with support for both files and syslog.
[cubemap] / log.h
diff --git a/log.h b/log.h
new file mode 100644 (file)
index 0000000..7e51fcb
--- /dev/null
+++ b/log.h
@@ -0,0 +1,24 @@
+#ifndef _LOG_H
+#define _LOG_H 1
+
+// Functions for common logging to file and syslog.
+
+#include <string>
+
+enum LogLevel {
+       NO_LEVEL,
+       INFO,
+       WARNING,
+       ERROR,
+};
+
+void add_log_destination_file(const std::string &filename);
+void add_log_destination_console();
+void add_log_destination_syslog();
+
+void start_logging();
+void shut_down_logging();
+
+void log(LogLevel log_level, const char *fmt, ...);
+
+#endif  // !defined(_LOG_H)