Browse Source

Merge pull request #6742

58981d4 Changed logging to make -logtimestamps to work also for -printtoconsole (Arne Brutschy)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
3b2d37c619
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 7
      src/util.cpp

7
src/util.cpp

@ -280,10 +280,13 @@ int LogPrintStr(const std::string &str) @@ -280,10 +280,13 @@ int LogPrintStr(const std::string &str)
{
int ret = 0; // Returns total number of characters written
static bool fStartedNewLine = true;
string strTimestamped = LogTimestampStr(str, &fStartedNewLine);
if (fPrintToConsole)
{
// print to console
ret = fwrite(str.data(), 1, str.size(), stdout);
ret = fwrite(strTimestamped.data(), 1, strTimestamped.size(), stdout);
fflush(stdout);
}
else if (fPrintToDebugLog)
@ -291,8 +294,6 @@ int LogPrintStr(const std::string &str) @@ -291,8 +294,6 @@ int LogPrintStr(const std::string &str)
boost::call_once(&DebugPrintInit, debugPrintInitFlag);
boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
string strTimestamped = LogTimestampStr(str, &fStartedNewLine);
// buffer if we haven't opened the log yet
if (fileout == NULL) {
assert(vMsgsBeforeOpenLog);

Loading…
Cancel
Save