Change rpi -> server
[matches/MCTX3420.git] / server / log.h
diff --git a/server/log.h b/server/log.h
new file mode 100644 (file)
index 0000000..99d54d0
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * @file log.h
+ * @purpose Declaration of functions for printing log messages and/or terminating program after a fatal error
+ */
+
+#ifndef _LOG_H
+#define _LOG_H
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdarg.h>
+
+
+// An enum to make the severity of log messages human readable in code
+enum {LOGERR=0, LOGWARN=1, LOGNOTE=2, LOGINFO=3,LOGDEBUG=4};
+
+extern void Log(int level, char * funct, char * fmt,...); // General function for printing log messages to stderr
+extern void Fatal(char * funct, char * fmt, ...); // Function that deals with a fatal error (prints a message, then exits the program).
+
+#endif //_LOG_H
+
+//EOF

UCC git Repository :: git.ucc.asn.au