Print a tagged message header on an output stream.
- Parameters
-
[in] | stream | the output stream |
[in] | tag | the message tag |
Definition at line 594 of file util.cpp.
References __D_ASSERT, csdbg::process::current_thread(), ERROR_TAG_FG, INFO_TAG_FG, csdbg::tracer::interface(), likely, csdbg::thread::name(), csdbg::tracer::proc(), unlikely, and WARNING_TAG_FG.
Referenced by csdbg::__cyg_profile_func_enter(), csdbg::__cyg_profile_func_exit(), dbg(), and csdbg::operator<<().
600 #ifdef CSDBG_WITH_COLOR_TERM
601 stream <<
"\e[38;5;" << std::dec;
607 else if (
likely(ch ==
'w') )
613 stream <<
"m[" << tag <<
"]\e[0m";
615 stream <<
"[" << tag <<
"]";
618 stream <<
" [" << std::dec << getpid() <<
", ";
619 stream <<
"0x" << std::hex << pthread_self();
621 const i8 *thr = NULL;
623 if (
likely(iface != NULL) )
624 thr = iface->proc()->current_thread()->name();
626 stream <<
" (" << ((thr != NULL) ? thr :
"anon") <<
")] ";
char i8
8-bit signed integer
static tracer * interface()
Get the interface object.
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
#define ERROR_TAG_FG
Tag color for error and exception messages.
#define WARNING_TAG_FG
Tag color for warning messages.
#define INFO_TAG_FG
Tag color for informational messages.
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
#define __D_ASSERT(x)
Assertion macro.