mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
Merge #9417: Do not evaluate hidden LogPrint arguments
407cdd6 Do not evaluate hidden LogPrint arguments (Pieter Wuille)
This commit is contained in:
commit
c4b7d4f79c
15
src/util.h
15
src/util.h
@ -73,14 +73,15 @@ bool LogAcceptCategory(const char* category);
|
|||||||
/** Send a string to the log output */
|
/** Send a string to the log output */
|
||||||
int LogPrintStr(const std::string &str);
|
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>
|
#define LogPrintf(...) do { \
|
||||||
static inline int LogPrint(const char* category, const char* fmt, const Args&... args)
|
LogPrintStr(tfm::format(__VA_ARGS__)); \
|
||||||
{
|
} while(0)
|
||||||
if(!LogAcceptCategory(category)) return 0; \
|
|
||||||
return LogPrintStr(tfm::format(fmt, args...));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
bool error(const char* fmt, const Args&... args)
|
bool error(const char* fmt, const Args&... args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user