diff options
| author | John Newbery <[email protected]> | 2017-05-10 15:49:00 -0400 |
|---|---|---|
| committer | John Newbery <[email protected]> | 2017-05-10 15:49:00 -0400 |
| commit | 761392db3a721728863f773d337d516125ddb23c (patch) | |
| tree | 019b8b3fd6ace4c42c698ff184141696515bc842 /src/util.cpp | |
| parent | Merge #10371: [tests] Clean up addrman_tests.cpp (diff) | |
| download | discoin-761392db3a721728863f773d337d516125ddb23c.tar.xz discoin-761392db3a721728863f773d337d516125ddb23c.zip | |
[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 cf10ee4aa..e310fefb6 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; |