LogBackend: include year in time stamp
Also use a numeric month instead of the month name.
This commit is contained in:
+2
-2
@@ -81,10 +81,10 @@ EnableLogTimestamp() noexcept
|
||||
static std::string_view
|
||||
log_date() noexcept
|
||||
{
|
||||
static constexpr size_t LOG_DATE_BUF_SIZE = std::char_traits<char>::length("Jan 22 15:43:14 : ") + 1;
|
||||
static constexpr size_t LOG_DATE_BUF_SIZE = std::char_traits<char>::length("2025-01-22 15:43:14 : ") + 1;
|
||||
static char buf[LOG_DATE_BUF_SIZE];
|
||||
time_t t = time(nullptr);
|
||||
return FmtUnsafeSV(buf, "{:%b %d %T} : "sv, fmt::localtime(t));
|
||||
return FmtUnsafeSV(buf, "{:%F %T} : "sv, fmt::localtime(t));
|
||||
}
|
||||
|
||||
#ifdef HAVE_SYSLOG
|
||||
|
||||
Reference in New Issue
Block a user