mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 03:33:32 +01:00
Merge #10383: [logging] log system time and mock time
761392d [logging] log system time and mock time (John Newbery)
Tree-SHA512: 0a4b3ad74bcac201be490fe12e4b45adeabc39030ac46f40e1aeb2a20b2f3963e4468e65798d8aaeca1818759cab55ff2b2aa214500aa11571492c3301dd31c1
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user