Minor Log.cpp update.
This commit is contained in:
parent
947eef21e2
commit
bf1db47043
17
Log.cpp
17
Log.cpp
@ -19,12 +19,17 @@ namespace coreutils {
|
|||||||
|
|
||||||
output = true;
|
output = true;
|
||||||
|
|
||||||
auto clock = std::chrono::system_clock::now();
|
std::stringstream temp;
|
||||||
time_t theTime = std::chrono::system_clock::to_time_t(clock);
|
struct timespec timex;
|
||||||
std::string timeOut = std::string(ctime(&theTime));
|
clock_gettime(CLOCK_REALTIME, &timex);
|
||||||
timeOut = timeOut.substr(0, timeOut.length() - 1);
|
temp << timex.tv_sec << "." << std::setfill('0') << std::setw(9) << timex.tv_nsec;
|
||||||
|
|
||||||
*this << timeOut;
|
// auto clock = std::chrono::system_clock::now();
|
||||||
|
// time_t theTime = std::chrono::system_clock::to_time_t(clock);
|
||||||
|
// std::string timeOut = std::string(ctime(&theTime));
|
||||||
|
// timeOut = timeOut.substr(0, timeOut.length() - 1);
|
||||||
|
|
||||||
|
*this << temp.str();
|
||||||
*this << " ";
|
*this << " ";
|
||||||
|
|
||||||
switch(level) {
|
switch(level) {
|
||||||
@ -63,7 +68,7 @@ namespace coreutils {
|
|||||||
if(output) {
|
if(output) {
|
||||||
|
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
out << seq << "." << this->str() << std::endl;;
|
out << this->str() << std::endl;;
|
||||||
|
|
||||||
mtx.lock();
|
mtx.lock();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user