LogBackend: include year in time stamp
Also use a numeric month instead of the month name.
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,6 +1,7 @@
|
||||
ver 0.24.1 (not yet released)
|
||||
* output
|
||||
- sndio: fix rounding error in volume calculation
|
||||
* log: include year in time stamp
|
||||
* fix build failure in the "id3tag" Meson subproject
|
||||
|
||||
ver 0.24 (2025/03/11)
|
||||
|
@@ -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