mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 17:45:38 +00:00
Merge pull request #627 from smithjd15/logTimestamp
Timestamp'ed log entries
This commit is contained in:
commit
ef33eaec51
|
@ -3,6 +3,7 @@
|
||||||
#include "utils/FileSystemUtil.h"
|
#include "utils/FileSystemUtil.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
LogLevel Log::reportingLevel = LogInfo;
|
LogLevel Log::reportingLevel = LogInfo;
|
||||||
FILE* Log::file = NULL; //fopen(getLogPath().c_str(), "w");
|
FILE* Log::file = NULL; //fopen(getLogPath().c_str(), "w");
|
||||||
|
@ -38,7 +39,8 @@ void Log::open()
|
||||||
|
|
||||||
std::ostringstream& Log::get(LogLevel level)
|
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;
|
messageLevel = level;
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
|
|
Loading…
Reference in a new issue