aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-09-18 18:03:21 +1000
committerGavin Andresen <[email protected]>2013-09-18 20:39:24 +1000
commite51321fb75f00194425e5ecc8ad77fd6762ec221 (patch)
tree586ba556ba95900b8bb5b5440cb957a096e77528 /src/util.cpp
parentMerge pull request #2985 from theuni/included-tests (diff)
downloaddiscoin-e51321fb75f00194425e5ecc8ad77fd6762ec221.tar.xz
discoin-e51321fb75f00194425e5ecc8ad77fd6762ec221.zip
Refactor: OutputDebugStringF -> LogPrint(category, ...)
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp10
1 files changed, 9 insertions, 1 deletions
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<string>& 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)
{