Use string object for log output buffering.
Clang doesn't want to pass a char array to boost::format and I can't be arsed finding out why.
This commit is contained in:
parent
f5fa3219b4
commit
d968bd8549
8
log.cpp
8
log.cpp
@ -115,10 +115,12 @@ util::detail::log (level_t level, boost::format &&format) {
|
||||
|
||||
static const boost::format LEVEL_FORMAT ("%s [%s] ");
|
||||
|
||||
char time_string[strlen("YYYY-mm-dd HHMMhSS") + 1];
|
||||
static const size_t time_len = strlen("YYYY-mm-dd HHMMhSS") + 1;
|
||||
std::string time_string (time_len, '\0');
|
||||
time_t unix_time = time (nullptr);
|
||||
if (0 == strftime (time_string,
|
||||
elems (time_string),
|
||||
|
||||
if (0 == strftime (&time_string[0],
|
||||
time_len,
|
||||
"%Y-%m-%d %H%Mh%S",
|
||||
localtime (&unix_time))) {
|
||||
unusual ();
|
||||
|
Loading…
Reference in New Issue
Block a user