aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-12-14 13:51:11 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-12-15 10:12:38 +0100
commit9e9056cd1a05e5868025553d2a8cb3e47cf45045 (patch)
treeccb955d1bd925032fb107b908f6cc7a836d9efe5 /src/util.cpp
parent8a7606f35bf6ce862996559d4860c9b7f618e9ee (diff)
downloadbitcoin-9e9056cd1a05e5868025553d2a8cb3e47cf45045.tar.xz
Remove -logtodebugger
`-logtodebugger` is a strange, obscure, WIN32-only (mostly MSVC) thing. Let's clean up the options a bit get rid of it. test_bitcoin was using fLogToDebugger as a way to prevent logging to debug.log. For this, add a boolean (not exposed as option) fLogToDebugLog that defaults to true and is disabled in the tests.
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/util.cpp b/src/util.cpp
index bedf59767b..280798f2fb 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -88,7 +88,7 @@ map<string, string> mapArgs;
map<string, vector<string> > mapMultiArgs;
bool fDebug = false;
bool fPrintToConsole = false;
-bool fPrintToDebugger = false;
+bool fPrintToDebugLog = true;
bool fDaemon = false;
bool fServer = false;
string strMiscWarning;
@@ -270,7 +270,7 @@ int LogPrint(const char* category, const char* pszFormat, ...)
ret += vprintf(pszFormat, arg_ptr);
va_end(arg_ptr);
}
- else if (!fPrintToDebugger)
+ else if (fPrintToDebugLog)
{
static bool fStartedNewLine = true;
boost::call_once(&DebugPrintInit, debugPrintInitFlag);
@@ -302,29 +302,6 @@ int LogPrint(const char* category, const char* pszFormat, ...)
va_end(arg_ptr);
}
-#ifdef WIN32
- if (fPrintToDebugger)
- {
- // accumulate and output a line at a time
- static std::string buffer;
-
- boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
-
- va_list arg_ptr;
- va_start(arg_ptr, pszFormat);
- buffer += vstrprintf(pszFormat, arg_ptr);
- va_end(arg_ptr);
-
- int line_start = 0, line_end;
- while((line_end = buffer.find('\n', line_start)) != -1)
- {
- OutputDebugStringA(buffer.substr(line_start, line_end - line_start).c_str());
- line_start = line_end + 1;
- ret += line_end-line_start;
- }
- buffer.erase(0, line_start);
- }
-#endif
return ret;
}