diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/util.h b/src/util.h index 97d2723bc4..e27ce121c8 100644 --- a/src/util.h +++ b/src/util.h @@ -73,14 +73,15 @@ bool LogAcceptCategory(const char* category); /** Send a string to the log output */ int LogPrintStr(const std::string &str); -#define LogPrintf(...) LogPrint(NULL, __VA_ARGS__) - -template<typename... Args> -static inline int LogPrint(const char* category, const char* fmt, const Args&... args) -{ - if(!LogAcceptCategory(category)) return 0; \ - return LogPrintStr(tfm::format(fmt, args...)); -} +#define LogPrint(category, ...) do { \ + if (LogAcceptCategory((category))) { \ + LogPrintStr(tfm::format(__VA_ARGS__)); \ + } \ +} while(0) + +#define LogPrintf(...) do { \ + LogPrintStr(tfm::format(__VA_ARGS__)); \ +} while(0) template<typename... Args> bool error(const char* fmt, const Args&... args) |