diff --git a/src/logger.cpp b/src/logger.cpp index 1f3dfdf..c015c06 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1,11 +1,3 @@ -// -// logger.cpp -// libsclogging -// -// Created by Bob Polis at 2020-04-29 -// Copyright (c) 2020 SwiftCoder. All rights reserved. -// - #include "logger.hpp" #include #include @@ -33,13 +25,12 @@ void logger::write_prefix(loglevel level, const char* file, int line, const char // retrieve accurate time for milliseconds display struct timeval secs; (void)::gettimeofday(&secs, nullptr); - int ms = static_cast(std::roundf(secs.tv_usec / 1000.0)) % 1000; // create a date/time stamp char dtstamp[20]; std::strftime(dtstamp, 20, "%F %T", std::localtime(&secs.tv_sec)); - std::cerr << dtstamp << "." << std::setfill('0') << std::setw(3) << ms << " "; + std::cerr << dtstamp << "." << std::setfill('0') << std::setw(6) << secs.tv_usec << " "; std::cerr << _name << "[" << ::getpid() << "] "; std::cerr << file << ":" << line << " " << func << "() "; std::cerr << '[' << loglevel_desc(level) << "] "; diff --git a/src/logger.hpp b/src/logger.hpp index f048f63..079ef35 100644 --- a/src/logger.hpp +++ b/src/logger.hpp @@ -1,11 +1,3 @@ -// -// logger.hpp -// libsclogging -// -// Created by Bob Polis at 2020-04-29 -// Copyright (c) 2020 SwiftCoder. All rights reserved. -// - #ifndef _logger_H_ #define _logger_H_