mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Do not evaluate hidden LogPrint arguments
This commit is contained in:
parent
e8cfe1ee2d
commit
407cdd6cb8
15
src/util.h
15
src/util.h
@ -74,14 +74,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__)
|
||||
#define LogPrint(category, ...) do { \
|
||||
if (LogAcceptCategory((category))) { \
|
||||
LogPrintStr(tfm::format(__VA_ARGS__)); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
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 LogPrintf(...) do { \
|
||||
LogPrintStr(tfm::format(__VA_ARGS__)); \
|
||||
} while(0)
|
||||
|
||||
template<typename... Args>
|
||||
bool error(const char* fmt, const Args&... args)
|
||||
|
Loading…
Reference in New Issue
Block a user