fixed leading zero in ms in timestamp

This commit is contained in:
Bob Polis 2020-04-29 18:23:45 +02:00
parent e0634dd77e
commit d3cd0b3de1

View File

@ -39,7 +39,7 @@ void logger::write_prefix(loglevel level, const char* file, int line, const char
char dtstamp[20]; char dtstamp[20];
std::strftime(dtstamp, 20, "%F %T", std::localtime(&secs.tv_sec)); std::strftime(dtstamp, 20, "%F %T", std::localtime(&secs.tv_sec));
std::cerr << dtstamp << "." << std::setw(3) << ms << " "; std::cerr << dtstamp << "." << std::setfill('0') << std::setw(3) << ms << " ";
std::cerr << _name << "[" << ::getpid() << "] "; std::cerr << _name << "[" << ::getpid() << "] ";
std::cerr << file << ":" << line << " " << func << "() "; std::cerr << file << ":" << line << " " << func << "() ";
std::cerr << '[' << loglevel_desc(level) << "] "; std::cerr << '[' << loglevel_desc(level) << "] ";