diff options
author | John Newbery <john@johnnewbery.com> | 2017-05-10 15:49:00 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-05-10 15:49:00 -0400 |
commit | 761392db3a721728863f773d337d516125ddb23c (patch) | |
tree | 019b8b3fd6ace4c42c698ff184141696515bc842 /src/util.cpp | |
parent | 4b766fcdd4ca16399075d1e081a321b3b05ce516 (diff) |
[logging] log system time and mock time
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp index cf10ee4aa5..e310fefb64 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -310,10 +310,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; |