Add better trace peudo-loglevel support
parent
388906ac70
commit
1f670fc688
|
@ -159,4 +159,5 @@ std::ostream actionstream(&actionbuf);
|
||||||
std::ostream infostream(&infobuf);
|
std::ostream infostream(&infobuf);
|
||||||
std::ostream verbosestream(&verbosebuf);
|
std::ostream verbosestream(&verbosebuf);
|
||||||
|
|
||||||
|
bool log_trace_level_enabled = false;
|
||||||
|
|
||||||
|
|
|
@ -69,5 +69,10 @@ extern std::ostream actionstream;
|
||||||
extern std::ostream infostream;
|
extern std::ostream infostream;
|
||||||
extern std::ostream verbosestream;
|
extern std::ostream verbosestream;
|
||||||
|
|
||||||
|
extern bool log_trace_level_enabled;
|
||||||
|
|
||||||
|
#define TRACESTREAM(x){ if(log_trace_level_enabled) verbosestream x; }
|
||||||
|
#define TRACEDO(x){ if(log_trace_level_enabled){ x ;} }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -854,8 +854,9 @@ int main(int argc, char *argv[])
|
||||||
// If trace is enabled, enable logging of certain things
|
// If trace is enabled, enable logging of certain things
|
||||||
if(cmd_args.getFlag("trace")){
|
if(cmd_args.getFlag("trace")){
|
||||||
dstream<<"Enabling trace level debug output"<<std::endl;
|
dstream<<"Enabling trace level debug output"<<std::endl;
|
||||||
dout_con_ptr = &verbosestream;
|
log_trace_level_enabled = true;
|
||||||
socket_enable_debug_output = true;
|
dout_con_ptr = &verbosestream; // this is somewhat old crap
|
||||||
|
socket_enable_debug_output = true; // socket doesn't use log.h
|
||||||
}
|
}
|
||||||
// In certain cases, output info level on stderr
|
// In certain cases, output info level on stderr
|
||||||
if(cmd_args.getFlag("info") || cmd_args.getFlag("verbose") ||
|
if(cmd_args.getFlag("info") || cmd_args.getFlag("verbose") ||
|
||||||
|
|
Loading…
Reference in New Issue