From 7de52b9279b447419dfe81ae4dbab3e38a80657c Mon Sep 17 00:00:00 2001 From: "James D. Smith" Date: Mon, 30 Dec 2019 22:06:13 -0700 Subject: [PATCH] Timestamp'ed log entries --- es-core/src/Log.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/es-core/src/Log.cpp b/es-core/src/Log.cpp index 951286519..bcae38488 100644 --- a/es-core/src/Log.cpp +++ b/es-core/src/Log.cpp @@ -3,6 +3,7 @@ #include "utils/FileSystemUtil.h" #include "platform.h" #include +#include LogLevel Log::reportingLevel = LogInfo; FILE* Log::file = NULL; //fopen(getLogPath().c_str(), "w"); @@ -38,7 +39,8 @@ void Log::open() std::ostringstream& Log::get(LogLevel level) { - os << "lvl" << level << ": \t"; + time_t t = time(nullptr); + os << std::put_time(localtime(&t), "%b %d %T ") << "lvl" << level << ": \t"; messageLevel = level; return os;