205 {
207 uint8_t lvl_=TLVL_DEBUG;
210 case ers::Log: lvl_=TLVL_LOG;
break;
215 }
216 struct { char tn[TRACE_TN_BUFSZ]; } _trc_;
218 if (traceControl_rwp->mode.bits.M && (traceLvls_p[traceTID].M & TLVLMSK(lvl_))) {
219 struct timeval lclTime;
220 std::chrono::system_clock::time_point tp{issue.
ptime()};
221
222 std::chrono::microseconds micros = std::chrono::duration_cast<std::chrono::microseconds>(tp.time_since_epoch());
223 lclTime.tv_sec = micros.count() / 1000000;
224 lclTime.tv_usec = micros.count() % 1000000;
226 std::string complete_message = issue.
message();
228 while ((issp=issp->
cause())) {
229 char fbuf[0x100], tbuf[0x40];
230 int strip_ns=1;
232 std::chrono::milliseconds millis
233 = std::chrono::duration_cast<std::chrono::milliseconds>(tp.time_since_epoch());
234 struct tm tm_s;
235 time_t secs = millis.count() / 1000;
236 localtime_r(&secs, &tm_s);
237 if (strftime(tbuf, sizeof(tbuf), "%Y-%b-%d %H:%M:%S", &tm_s) == 0)
238 tbuf[0]= '\0';
239 complete_message += "\n\tcaused by: " + std::string(tbuf);
240 int milliseconds = millis.count() % 1000;
241 sprintf(tbuf,",%03d ",milliseconds);
242 complete_message += std::string(tbuf);
245 + " [" + fbuf + " at "
249 }
252 0 TRACE_XTRA_PASSED, complete_message.c_str());
253 }
254 }
256 }
virtual int line_number() const =0
virtual const char * file_name() const =0
virtual const char * function_name() const =0
Base class for any user define issue.
const Context & context() const
Context of the issue.
ers::Severity severity() const
severity of the issue
const system_clock::time_point & ptime() const
original time point of the issue
const std::string & message() const
General cause of the issue.
const Issue * cause() const
return the cause Issue of this Issue
virtual void write(const Issue &issue)=0
std::string to_string(severity s)