mirror of https://github.com/oxen-io/lokinet
Replace abseil date code with Hinnart's date.h
Howard Hinnart's date.h is the library that was accepted as C++20 date/calendar support, so this is essentially a backport of C++20 date time support. (It does support timezone support, but requires more of the library and that seems like overkill for what we need; this just prints UTC timestamps instead, which need only a header-only include).pull/1124/head
parent
ba1b20153e
commit
2e9840ea39
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 9a0ee2542848ab8625984fc8cdbfb9b5414c0082
|
@ -0,0 +1,15 @@
|
|||||||
|
#include <util/logging/logger_internal.hpp>
|
||||||
|
|
||||||
|
#include <date/date.h>
|
||||||
|
|
||||||
|
namespace llarp
|
||||||
|
{
|
||||||
|
std::ostream&
|
||||||
|
operator<<(std::ostream& out, const log_timestamp& ts)
|
||||||
|
{
|
||||||
|
std::chrono::time_point< std::chrono::system_clock,
|
||||||
|
std::chrono::milliseconds >
|
||||||
|
now{std::chrono::milliseconds{ts.now}};
|
||||||
|
return date::operator<<(out, now) << " UTC [+" << ts.delta << " ms]";
|
||||||
|
}
|
||||||
|
} // namespace llarp
|
Loading…
Reference in New Issue