Jafar
|
Debug message stream. More...
Debug message stream.
The default output stream is std::cerr. In order to send messages to the debugStream, you should use macros JFR_WARNING, JFR_DEBUG, JFR_VDEBUG, JFR_VVDEBUG defined in jafarMacro.hpp.
Definition at line 39 of file jafarDebug.hpp.
#include <jafarDebug.hpp>
Public Types | |
enum | Level { Off = 0, Trace = 1, Warning = 2, Debug = 3, VerboseDebug = 4, VeryVerboseDebug = 5 } |
Levels of the debug output. More... | |
Static Public Member Functions | |
static void | setDefaultLevel (Level level_) |
Set the default debug level. | |
static void | setLevel (std::string const &module_, Level level_) |
set the level for a given module | |
static void | moduleOff (std::string const &module_) |
shortcut for setLevel(module_, DebugStream::Off) | |
static void | moduleWarning (std::string const &module_) |
shortcut for setLevel(module_, DebugStream::Warning) | |
static void | moduleDebug (std::string const &module_) |
shortcut for setLevel(module_, DebugStream::Debug) | |
static void | moduleVerboseDebug (std::string const &module_) |
shortcut for setLevel(module_, DebugStream::VerboseDebug) | |
static void | moduleVeryVerboseDebug (std::string const &module_) |
shortcut for setLevel(module_, DebugStream::VeryVerboseDebug) | |
static void | unsetModule (std::string const &module_) |
unset debug level configuration for module_ | |
static void | setOutputFile (std::string const &filename_) |
send the debug stream to filename_. | |
static void | setDefaultStream () |
send the debug stream to the default stream (std::cerr). | |
static void | setStream (std::ostream &os_) |
send the debug stream to the given stream os_. | |
static void | setup (std::string const &module_, Level level_, bool display_=true) |
Call this method before sending any data to the stream. | |
static void | sendLocation (std::string const &module_, char const *file_, int line_) |
Send the given location to the debug stream. | |
static DebugStream & | instance () |
Returns the unique instance of the debug stream. | |
Private Member Functions | |
bool | isDebugging () const |
Static Private Member Functions | |
static std::ostream & | stream () |
Private Attributes | |
std::ostream * | debugStream |
Debug output stream pointer. | |
std::ofstream | fileStream |
file stream used when sending the debug to a file. | |
bool | fsOpen |
std::map< std::string, Level > | modulesLevel |
Level | defaultLevel |
level used when module level is not set. | |
bool | debugging |
Friends | |
class | boost::serialization::detail::singleton_wrapper< DebugStream > |
DebugStream & | operator<< (DebugStream &debugStream, details::stream_function function) |
DebugStream & | operator<< (DebugStream &debugStream, details::iosbase_function function) |
DebugStream & | endl (DebugStream &debugStream) |
template<typename T > | |
DebugStream & | operator<< (DebugStream &debugStream, T const &value) |
Levels of the debug output.
Off |
nothing |
Trace |
trace message for non-jafar exceptions |
Warning |
warning message |
Debug |
debug message, this is the default level |
VerboseDebug |
verbose debug |
VeryVerboseDebug |
very verbose debug |
Definition at line 44 of file jafarDebug.hpp.
static DebugStream& jafar::debug::DebugStream::instance | ( | ) | [inline, static] |
Returns the unique instance of the debug stream.
Definition at line 121 of file jafarDebug.hpp.
Referenced by setDefaultLevel(), setLevel(), setStream(), stream(), and unsetModule().
bool jafar::debug::DebugStream::isDebugging | ( | ) | const [inline, private] |
Definition at line 149 of file jafarDebug.hpp.
static void jafar::debug::DebugStream::sendLocation | ( | std::string const & | module_, |
char const * | file_, | ||
int | line_ | ||
) | [static] |
Send the given location to the debug stream.
Format of this location is controlled by the flag JFR_DEBUG_FULL_PATH.
static void jafar::debug::DebugStream::setDefaultLevel | ( | Level | level_ | ) | [inline, static] |
Set the default debug level.
This level is used when no level is specified for a given module.
Definition at line 55 of file jafarDebug.hpp.
References defaultLevel, and instance().
static void jafar::debug::DebugStream::setup | ( | std::string const & | module_, |
Level | level_, | ||
bool | display_ = true |
||
) | [static] |
Call this method before sending any data to the stream.
static std::ostream& jafar::debug::DebugStream::stream | ( | ) | [inline, static, private] |
Definition at line 152 of file jafarDebug.hpp.
References debugStream, and instance().
Generated on Wed Oct 15 2014 00:37:34 for Jafar by doxygen 1.7.6.1 |