From f21fc6153ec47f3aa4ee970bee5953c1c3acf20d Mon Sep 17 00:00:00 2001 From: Stephen Hall Date: Tue, 8 Oct 2013 13:57:08 -0400 Subject: [PATCH] Timestamps appear as 01:02:03 instead of 1:2:3. Uses std::put_time --- src/Debug.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Debug.hpp b/src/Debug.hpp index 0094fd6..815b265 100644 --- a/src/Debug.hpp +++ b/src/Debug.hpp @@ -2,6 +2,7 @@ #define __DebuggingLoggerUtility_HeaderPlusPlus__ #include +#include #include #include #include @@ -79,7 +80,7 @@ class LogUtil //replaces std::clog, std::cerr, std::cout with file streams std::tm *local_time = std::localtime(&curr_time_raw); std::stringstream time; - time << "[" << local_time->tm_hour << ":" << local_time->tm_min << ":" << local_time->tm_sec << "] "; + time << "[" << std::put_time(local_time, "%T") << "] "; return time.str(); }