diff --git a/src/xs_logging.cpp b/src/xs_logging.cpp index d4aabce..90e2916 100644 --- a/src/xs_logging.cpp +++ b/src/xs_logging.cpp @@ -31,13 +31,14 @@ #include #include -#include +#include #include #include +#include +#include #include #include #include -#include namespace interbotix_xs @@ -81,6 +82,14 @@ void log(logging::Level level, const char * fmt, ...) break; } + auto duration = std::chrono::system_clock::now().time_since_epoch(); + double seconds = std::chrono::duration(duration).count(); + + msg = msg + + " [" + + std::to_string(seconds) + + "] "; + va_list args; va_start(args, fmt); size_t size = 1024;