X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=inline;f=server%2Flog.h;fp=server%2Flog.h;h=6db52f638afd492ac917dfc87eab5010dedddbbd;hb=43c1519cb60f8fef09043b9af6f43d319db12e3d;hp=99d54d09ab55ad8bdc1be11a9bce0d8b74ebc053;hpb=733a9b968264c48b5340693ce17e1874c1aeff77;p=matches%2FMCTX3420.git diff --git a/server/log.h b/server/log.h index 99d54d0..6db52f6 100644 --- a/server/log.h +++ b/server/log.h @@ -11,12 +11,15 @@ #include #include +//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}; -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). +extern void LogEx(int level, const char * funct, ...); // General function for printing log messages to stderr +extern void FatalEx(const char * funct, ...); // Function that deals with a fatal error (prints a message, then exits the program). #endif //_LOG_H