aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-05-16 08:06:26 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-05-16 08:10:05 +0200
commitd0c37ee78984e5a983758814c73f062eb9903b88 (patch)
tree6c00452f7a80ebe8f3653172d2fb374f5f6769c1 /src/util.cpp
parentb6ee855b411ee9bc39f935d0da3298a773a2ed37 (diff)
parent761392db3a721728863f773d337d516125ddb23c (diff)
downloadbitcoin-d0c37ee78984e5a983758814c73f062eb9903b88.tar.xz
Merge #10383: [logging] log system time and mock time
761392d [logging] log system time and mock time (John Newbery) Tree-SHA512: 0a4b3ad74bcac201be490fe12e4b45adeabc39030ac46f40e1aeb2a20b2f3963e4468e65798d8aaeca1818759cab55ff2b2aa214500aa11571492c3301dd31c1
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 2f0f846291..653a4f072a 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -306,10 +306,14 @@ static std::string LogTimestampStr(const std::string &str, std::atomic_bool *fSt
return str;
if (*fStartedNewLine) {
- int64_t nTimeMicros = GetLogTimeMicros();
+ int64_t nTimeMicros = GetTimeMicros();
strStamped = DateTimeStrFormat("%Y-%m-%d %H:%M:%S", nTimeMicros/1000000);
if (fLogTimeMicros)
strStamped += strprintf(".%06d", nTimeMicros%1000000);
+ int64_t mocktime = GetMockTime();
+ if (mocktime) {
+ strStamped += " (mocktime: " + DateTimeStrFormat("%Y-%m-%d %H:%M:%S", mocktime) + ")";
+ }
strStamped += ' ' + str;
} else
strStamped = str;