From e51321fb75f00194425e5ecc8ad77fd6762ec221 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 18 Sep 2013 18:03:21 +1000 Subject: Refactor: OutputDebugStringF -> LogPrint(category, ...) --- src/util.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp index 16c8f3fc1..466f6ddff 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -233,8 +233,16 @@ static void DebugPrintInit() mutexDebugLog = new boost::mutex(); } -int OutputDebugStringF(const char* pszFormat, ...) +int LogPrint(const char* category, const char* pszFormat, ...) { + if (category != NULL) + { + if (!fDebug) return 0; + const vector& categories = mapMultiArgs["-debug"]; + if (find(categories.begin(), categories.end(), string(category)) == categories.end()) + return 0; + } + int ret = 0; // Returns total number of characters written if (fPrintToConsole) { -- cgit v1.2.3