Changes to add thread id to Log.
This commit is contained in:
parent
bf1db47043
commit
018c130df1
@ -13,11 +13,11 @@ namespace coreutils {
|
|||||||
uri = in.getTokenExclude(" ");
|
uri = in.getTokenExclude(" ");
|
||||||
if(!in.ifNext(" "))
|
if(!in.ifNext(" "))
|
||||||
throw coreutils::Exception("Expecting space after URI.");
|
throw coreutils::Exception("Expecting space after URI.");
|
||||||
protocol = in.getTokenExclude("\r\n");
|
protocol = in.getTokenExclude("\r");
|
||||||
|
|
||||||
coreutils::Log(coreutils::LOG_DEBUG_4) << "[" << in.str() << "]";
|
coreutils::Log(coreutils::LOG_DEBUG_4) << "[" << in.str() << "]";
|
||||||
|
|
||||||
if(!in.ifNext("\r\n"))
|
if(!in.ifNext("\r"))
|
||||||
throw coreutils::Exception("Expecting CRLF after protocol.");
|
throw coreutils::Exception("Expecting CRLF after protocol.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
Log.cpp
7
Log.cpp
@ -24,14 +24,11 @@ namespace coreutils {
|
|||||||
clock_gettime(CLOCK_REALTIME, &timex);
|
clock_gettime(CLOCK_REALTIME, &timex);
|
||||||
temp << timex.tv_sec << "." << std::setfill('0') << std::setw(9) << timex.tv_nsec;
|
temp << timex.tv_sec << "." << std::setfill('0') << std::setw(9) << timex.tv_nsec;
|
||||||
|
|
||||||
// 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 << temp.str();
|
||||||
*this << " ";
|
*this << " ";
|
||||||
|
|
||||||
|
*this << "[" << syscall(SYS_gettid) << "]";
|
||||||
|
|
||||||
switch(level) {
|
switch(level) {
|
||||||
case LOG_NONE:
|
case LOG_NONE:
|
||||||
*this << "[NONE] :";
|
*this << "[NONE] :";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user