From 018c130df18760822ca8d5d48e64763aad310ba5 Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Thu, 23 Apr 2020 14:21:06 -0700 Subject: [PATCH] Changes to add thread id to Log. --- IMFRequest.cpp | 4 ++-- Log.cpp | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/IMFRequest.cpp b/IMFRequest.cpp index 7d03857..76e70e6 100644 --- a/IMFRequest.cpp +++ b/IMFRequest.cpp @@ -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."); } diff --git a/Log.cpp b/Log.cpp index 5a75a15..556106c 100644 --- a/Log.cpp +++ b/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] :";