Timestamp'ed log entries

This commit is contained in:
James D. Smith 2019-12-30 22:06:13 -07:00
parent 714797e778
commit 7de52b9279

View file

@ -3,6 +3,7 @@
#include "utils/FileSystemUtil.h"
#include "platform.h"
#include <iostream>
#include <iomanip>
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;