Skip to content

Commit

Permalink
Logging: added seconds to log time string.
Browse files Browse the repository at this point in the history
Time was only in minutes before.
Seconds is more useful in analyzing the log for example
with issues of timeouts, and reponse times.
  • Loading branch information
geneticdrift authored and MaxKellermann committed Jan 29, 2025
1 parent f6bd49b commit 88594c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LogBackend.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ EnableLogTimestamp() noexcept
static const char *
log_date() noexcept
{
static constexpr size_t LOG_DATE_BUF_SIZE = 16;
static constexpr size_t LOG_DATE_BUF_SIZE = std::char_traits<char>::length("Jan 22 15:43:14 : ") + 1;
static char buf[LOG_DATE_BUF_SIZE];
time_t t = time(nullptr);
strftime(buf, LOG_DATE_BUF_SIZE, "%b %d %H:%M : ", localtime(&t));
strftime(buf, LOG_DATE_BUF_SIZE, "%b %d %H:%M:%S : ", localtime(&t));
return buf;
}

Expand Down

0 comments on commit 88594c8

Please sign in to comment.