git.ucc.asn.au
/
matches
/
MCTX3420.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Progress on Framework for Server software
[matches/MCTX3420.git]
/
server
/
log.h
diff --git
a/server/log.h
b/server/log.h
index
99d54d0
..
005059c
100644
(file)
--- a/
server/log.h
+++ b/
server/log.h
@@
-10,13
+10,17
@@
#include <stdio.h>
#include <stdbool.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdarg.h>
+#include "common.h"
+//To get around a 'pedantic' C99 rule that you must have at least 1 variadic arg, combine fmt into that.
+#define Log(level, ...) LogEx(level, __func__, __VA_ARGS__)
+#define Fatal(...) FatalEx(__func__, __VA_ARGS__)
// An enum to make the severity of log messages human readable in code
enum {LOGERR=0, LOGWARN=1, LOGNOTE=2, LOGINFO=3,LOGDEBUG=4};
// 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 * fm
t, ...); // Function that deals with a fatal error (prints a message, then exits the program).
+extern void Log
Ex(int level, const char * funct,
...); // General function for printing log messages to stderr
+extern void Fatal
Ex(const char * func
t, ...); // Function that deals with a fatal error (prints a message, then exits the program).
#endif //_LOG_H
#endif //_LOG_H
UCC
git Repository :: git.ucc.asn.au