aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-09-18 18:03:21 +1000
committerGavin Andresen <gavinandresen@gmail.com>2013-09-18 20:39:24 +1000
commite51321fb75f00194425e5ecc8ad77fd6762ec221 (patch)
tree586ba556ba95900b8bb5b5440cb957a096e77528 /src/util.cpp
parentb16e9f02c82b98635da53c7e485614cba766f0a9 (diff)
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 16c8f3fc17..466f6ddff6 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)
{