diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-07-29 12:32:38 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-07-29 12:32:47 +0200 |
commit | 7a2d4027271750139f4df51619aa2cfbe49f6665 (patch) | |
tree | e86c54914af0b6481311d5165449376541b47467 /src/util.h | |
parent | b77bb95b3cb414ffef91d4ac11c4b15720200712 (diff) | |
parent | a5072a773071b8f4b644f84a77643e2ad18dba3a (diff) | |
download | bitcoin-7a2d4027271750139f4df51619aa2cfbe49f6665.tar.xz |
Merge #8274: util: Update tinyformat
a5072a7 util: Remove zero-argument versions of LogPrint and error (Wladimir J. van der Laan)
695041e util: Update tinyformat (Wladimir J. van der Laan)
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/util.h b/src/util.h index ac4b947785..39328b51ef 100644 --- a/src/util.h +++ b/src/util.h @@ -77,33 +77,17 @@ int LogPrintStr(const std::string &str); #define LogPrintf(...) LogPrint(NULL, __VA_ARGS__) -template<typename T1, typename... Args> -static inline int LogPrint(const char* category, const char* fmt, const T1& v1, const Args&... 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, v1, args...)); + return LogPrintStr(tfm::format(fmt, args...)); } -template<typename T1, typename... Args> -bool error(const char* fmt, const T1& v1, const Args&... args) +template<typename... Args> +bool error(const char* fmt, const Args&... args) { - LogPrintStr("ERROR: " + tfm::format(fmt, v1, args...) + "\n"); - return false; -} - -/** - * Zero-arg versions of logging and error, these are not covered by - * the variadic templates above (and don't take format arguments but - * bare strings). - */ -static inline int LogPrint(const char* category, const char* s) -{ - if(!LogAcceptCategory(category)) return 0; - return LogPrintStr(s); -} -static inline bool error(const char* s) -{ - LogPrintStr(std::string("ERROR: ") + s + "\n"); + LogPrintStr("ERROR: " + tfm::format(fmt, args...) + "\n"); return false; } |