INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
gbxutilacfr::Tracer Class ReferenceLocal and remote tracing. More...
Inherited by gbxutilacfr::TrivialTracer. Inheritance diagram for gbxutilacfr::Tracer:
Detailed DescriptionLocal and remote tracing.Tracer is used to log human-readable trace statements, e.g. warnings, error messages, etc (not data). A single Tracer object is meant to be shared by multiple threads, so the implementation must be thread-safe. When the tracing message is cheap to generate, simply call one of the tracing functions. The routing to destinations will be performed internally.
//! std::string s = "something is wrong"; //! tracer->error( s ); //! If the tracing message is a result of an expensive operation, you many want to perform the tracing test yourself and then call the tracing function. You may test verbosity for specific TraceType / DestinationType combinations or use summary fields AnyTrace and ToAny.
//! Tracer* tracer = context().tracer(); //! if ( tracer.verbosity( gbxutilacfr::Tracer::ErrorTrace, gbxutilacfr::Tracer::ToAny ) > 0 ) { //! std::string s = expensiveOperation(); //! tracer.error( s ); //! } //! Enum gbxutilacfr::Tracer::TraceType defines types of traced information. Enum gbxutilacfr::Tracer::DestinationType defines possible tracer destinations are. Verbosity levels range from 0 (nothing) to 10 (everything). The built-in defaults are as follows: //! ToDisplay ToNetwork ToLog ToFile //! Info 1 0 0 0 //! Warning 1 0 0 0 //! Error 10 0 0 0 //! Debug 0 0 0 0 //!
Member Enumeration DocumentationTypes of destinations for traced information.
Types of traced information.
Member Function Documentation
EXPERIMENTAL. Debug tracing for an individual subsystem. Only debug-to-display is supported. The maximum traceable level is set per-subsystem with setLevel().
LOCAL INTERFACE. Prints out verbatim to stdout. It is never routed over the network.
Implemented in gbxutilacfr::TrivialTracer.
EXPERIMENTAL. Sets debug level for an individual subsystem. Only debug-to-display is supported.
Returns the verbosity level for traceType to destType. This test is performed internally by all tracing functions, e.g. error(). You may want to call this function yourself before calling error() if there is a significant overhead in forming the tracing string. See class documentation for an example of such usage.
The documentation for this class was generated from the following file: |