Logging: added seconds to log time string.
Time was only in minutes before. Seconds is more useful in analyzing the log for example with issues of timeouts, and reponse times.
This commit is contained in:
parent
f6bd49ba61
commit
88594c81d6
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user