feat/update_config #10
@ -389,7 +389,7 @@ LogSink::ToString(LogSeverity severity,
|
||||
{
|
||||
std::stringstream ss;
|
||||
char date_time[64];
|
||||
sprintf(date_time, "%4d-%02d-%02dT%02d:%02d:%02d.%06d", logmsgtime.year() + 1900, logmsgtime.month(),
|
||||
sprintf(date_time, "%4d-%02d-%02dT%02d:%02d:%02d.%06d", logmsgtime.year() + 1900, logmsgtime.month() + 1,
|
||||
logmsgtime.day(), logmsgtime.hour(), logmsgtime.min(), logmsgtime.sec(), logmsgtime.usec());
|
||||
|
||||
ss << date_time;
|
||||
|
@ -23,6 +23,8 @@ BasicFileSink::Send(LogSeverity severity,
|
||||
size_t message_len)
|
||||
{
|
||||
TILE_CHECK(!filepath_.empty(), "filepath is empty");
|
||||
auto msg = ToString(severity, full_filename, base_filename, line, logmsgtime, message, message_len);
|
||||
while (!msg.empty() && msg.back() != '\n') { msg.push_back('\n'); }
|
||||
ofs_ << std::string(message, message_len) << std::endl;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user