INFO
Always
- If you want to have debug output from time critical code you should
+ If you want to have debug output from time critical code you should
use this construct:
if (debug.debugging(Debug::INFO)) {
- debug << "...debug output...\n";
+ debug << "...debug output...\n";
}
-
+
To give debug info even if no debug (NONE) is requested:
debug << "... always output ...\n";
public:
/// Constructor, sets the debug level to t.
explicit DebugStream(Debug::type t = Debug::NONE);
-
+
/// Constructor, sets the log file to f, and the debug level to t.
explicit
DebugStream(char const * f, Debug::type t = Debug::NONE);
/// Sets the debugstreams' logfile to f.
void logFile(char const * f);
-
+
/// Returns true if t is part of the current debug level.
bool debugging(Debug::type t = Debug::ANY) const
{
return false;
}
-
+
/** Returns the no-op stream if t is not part of the
current debug level otherwise the real debug stream
is used.
return nullstream;
}
-
+
/** This is an operator to give a more convenient use:
dbgstream[Debug::INFO] << "Info!\n";
*/
};
#endif
-
-