mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
Nice timestamp format using Howard Hinnant's header only date C++ library
Signed-off-by: Mihai Stefanescu <mihai.t.gh.stefanescu@gmail.com>
This commit is contained in:
parent
422b6926b5
commit
1018ffea16
8433
include/date.h
Normal file
8433
include/date.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -24,12 +24,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include "date.h"
|
||||||
|
|
||||||
/* Helper macro for logger utility class. */
|
/* Helper macro for logger utility class. */
|
||||||
#define UPM_LOG(log_level) \
|
#define UPM_LOG(log_level) \
|
||||||
@ -67,10 +67,10 @@ class UPM_LOGGER
|
|||||||
std::ofstream&
|
std::ofstream&
|
||||||
log(UpmLogLevel level = LOG_ERROR)
|
log(UpmLogLevel level = LOG_ERROR)
|
||||||
{
|
{
|
||||||
using namespace std::chrono;
|
using namespace date;
|
||||||
|
|
||||||
_logStream << "UPM - "
|
_logStream << "UPM - "
|
||||||
<< duration_cast<nanoseconds>(system_clock::now().time_since_epoch()).count();
|
<< std::chrono::system_clock::now();
|
||||||
_logStream << " [" << getLogLevelName(level) << "] ";
|
_logStream << " [" << getLogLevelName(level) << "] ";
|
||||||
|
|
||||||
return _logStream;
|
return _logStream;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user