Permalink
Browse files

Merge pull request #6742

58981d4 Changed logging to make -logtimestamps to work also for -printtoconsole (Arne Brutschy)
  • Loading branch information...
laanwj committed Oct 5, 2015
2 parents a75c673 + 58981d4 commit 3b2d37c61963d423c9147d342a0985ced33ae4f1
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/util.cpp
View
@@ -280,19 +280,20 @@ 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)
{
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);

0 comments on commit 3b2d37c

Please sign in to comment.