diff --git a/logger.cpp b/logger.cpp index dcb0816..1f3dfdf 100644 --- a/logger.cpp +++ b/logger.cpp @@ -39,7 +39,7 @@ void logger::write_prefix(loglevel level, const char* file, int line, const char char dtstamp[20]; 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 << file << ":" << line << " " << func << "() "; std::cerr << '[' << loglevel_desc(level) << "] ";