mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
refactor: Replace GetTimeMicros by SystemClock
This commit is contained in:
parent
8d12127a9c
commit
faf3f12424
3 changed files with 9 additions and 13 deletions
|
|
@ -349,11 +349,12 @@ std::string BCLog::Logger::LogTimestampStr(const std::string& str)
|
|||
return str;
|
||||
|
||||
if (m_started_new_line) {
|
||||
int64_t nTimeMicros = GetTimeMicros();
|
||||
strStamped = FormatISO8601DateTime(nTimeMicros/1000000);
|
||||
const auto now{SystemClock::now()};
|
||||
const auto now_seconds{std::chrono::time_point_cast<std::chrono::seconds>(now)};
|
||||
strStamped = FormatISO8601DateTime(TicksSinceEpoch<std::chrono::seconds>(now_seconds));
|
||||
if (m_log_time_micros) {
|
||||
strStamped.pop_back();
|
||||
strStamped += strprintf(".%06dZ", nTimeMicros%1000000);
|
||||
strStamped += strprintf(".%06dZ", Ticks<std::chrono::microseconds>(now - now_seconds));
|
||||
}
|
||||
std::chrono::seconds mocktime = GetMockTime();
|
||||
if (mocktime > 0s) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue