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(" ");
|
||||
if(!in.ifNext(" "))
|
||||
throw coreutils::Exception("Expecting space after URI.");
|
||||
protocol = in.getTokenExclude("\r\n");
|
||||
protocol = in.getTokenExclude("\r");
|
||||
|
||||
coreutils::Log(coreutils::LOG_DEBUG_4) << "[" << in.str() << "]";
|
||||
|
||||
if(!in.ifNext("\r\n"))
|
||||
if(!in.ifNext("\r"))
|
||||
throw coreutils::Exception("Expecting CRLF after protocol.");
|
||||
}
|
||||
|
||||
|
7
Log.cpp
7
Log.cpp
@ -23,15 +23,12 @@ namespace coreutils {
|
||||
struct timespec timex;
|
||||
clock_gettime(CLOCK_REALTIME, &timex);
|
||||
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 << " ";
|
||||
|
||||
*this << "[" << syscall(SYS_gettid) << "]";
|
||||
|
||||
switch(level) {
|
||||
case LOG_NONE:
|
||||
*this << "[NONE] :";
|
||||
|
Loading…
x
Reference in New Issue
Block a user