Skip to content

Commit

Permalink
Changed logging to make -logtimestamps to work also for -printtoconsole
Browse files Browse the repository at this point in the history
  • Loading branch information
arnuschky committed Sep 30, 2015
1 parent 4f44530 commit 58981d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/util.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 58981d4

Please sign in to comment.