aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorArne Brutschy <abrutschy@xylon.de>2015-09-30 17:57:28 +0200
committerArne Brutschy <abrutschy@xylon.de>2015-09-30 17:57:28 +0200
commit58981d4f7d3cab872239f5aa3a8125e06cb93bfd (patch)
tree08e990c35bea2d1da8da249036bb4a8be2b57a81 /src/util.cpp
parent4f44530bc38fb8367c2b9bde21492b545e7f7f26 (diff)
downloadbitcoin-58981d4f7d3cab872239f5aa3a8125e06cb93bfd.tar.xz
Changed logging to make -logtimestamps to work also for -printtoconsole
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util.cpp b/src/util.cpp
index f50d25e17a..8192a7c71c 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -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)
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);