INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
gbxutilacfr::Tracer Class Referenceabstract

Local and remote tracing. More...

#include <tracer.h>

Inheritance diagram for gbxutilacfr::Tracer:
Inheritance graph

Public Member Functions

virtual void print (const std::string &message)=0
 LOCAL INTERFACE. More...
 
virtual void info (const std::string &message, int level=1, bool localOnly=false)
 
virtual void info (const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false)=0
 This version gives the Tracer some hints about a specific subsytem which generated the message.
 
virtual void warning (const std::string &message, int level=1, bool localOnly=false)
 
virtual void warning (const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false)=0
 This version gives the Tracer some hints about a specific subsytem which generated the message.
 
virtual void error (const std::string &message, int level=1, bool localOnly=false)
 
virtual void error (const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false)=0
 This version gives the Tracer some hints about a specific subsytem which generated the message.
 
virtual void debug (const std::string &message, int level=1, bool localOnly=false)
 
virtual void debug (const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false)=0
 This version gives the Tracer some hints about a specific subsytem which generated the message.
 
virtual int verbosity (TraceType traceType, DestinationType destType=ToAny) const =0
 
virtual void setSubsystemDebugLevel (const std::string &subsystem, int level=0)
 
virtual void subsystemDebug (const std::string &subsystem, const std::string &message, int level=1)
 

Detailed Description

Local 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::TraceType defines types of traced
information. Enum gbxutilacfr::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
//! 
@see Status

Member Function Documentation

◆ debug()

virtual void gbxutilacfr::Tracer::debug ( const std::string &  message,
int  level = 1,
bool  localOnly = false 
)
inlinevirtual

Routing is determined by DebugToXxx parameter. If localOnly is set to TRUE, messages are not sent over the network (useful when traces is caused by network errors).

Reimplemented in gbxutilacfr::TrivialTracer.

References gbxutilacfr::ToAny.

Referenced by gbxsickacfr::Driver::Driver(), gbxgarminacfr::Driver::Driver(), gbxsmartbatteryacfr::OceanServerReader::read(), gbxgarminacfr::Driver::read(), gbxsmartbatteryacfr::OceanServerReader::reset(), gbxiceutilacfr::SafeThread::run(), and gbxsmartbatteryacfr::OceanServer::walk().

◆ error()

virtual void gbxutilacfr::Tracer::error ( const std::string &  message,
int  level = 1,
bool  localOnly = false 
)
inlinevirtual

Routing is determined by ErrorToXxx parameter. If localOnly is set to TRUE, messages are not sent over the network (useful when traces is caused by network errors).

Reimplemented in gbxutilacfr::TrivialTracer.

Referenced by gbxgarminacfr::Driver::Driver(), gbxgarminacfr::Driver::read(), and gbxiceutilacfr::SafeThread::run().

◆ info()

virtual void gbxutilacfr::Tracer::info ( const std::string &  message,
int  level = 1,
bool  localOnly = false 
)
inlinevirtual

Routing is determined by InfoToXxx parameter. If localOnly is set to TRUE, messages are not sent over the network (useful when traces is caused by network errors).

Reimplemented in gbxutilacfr::TrivialTracer.

Referenced by gbxsickacfr::Driver::Driver(), gbxgarminacfr::Driver::Driver(), and gbxnovatelacfr::Driver::Driver().

◆ print()

virtual void gbxutilacfr::Tracer::print ( const std::string &  message)
pure virtual

LOCAL INTERFACE.

Prints out verbatim to stdout. It is never routed over the network.

See also
info

Implemented in gbxutilacfr::TrivialTracer.

◆ setSubsystemDebugLevel()

virtual void gbxutilacfr::Tracer::setSubsystemDebugLevel ( const std::string &  subsystem,
int  level = 0 
)
inlinevirtual

EXPERIMENTAL. Sets debug level for an individual subsystem. Only debug-to-display is supported.

◆ subsystemDebug()

virtual void gbxutilacfr::Tracer::subsystemDebug ( const std::string &  subsystem,
const std::string &  message,
int  level = 1 
)
inlinevirtual

EXPERIMENTAL. Debug tracing for an individual subsystem. Only debug-to-display is supported. The maximum traceable level is set per-subsystem with setLevel().

◆ verbosity()

virtual int gbxutilacfr::Tracer::verbosity ( TraceType  traceType,
DestinationType  destType = ToAny 
) const
pure virtual

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.

Implemented in gbxutilacfr::TrivialTracer.

◆ warning()

virtual void gbxutilacfr::Tracer::warning ( const std::string &  message,
int  level = 1,
bool  localOnly = false 
)
inlinevirtual

Routing is determined by WarningToXxx parameter. If localOnly is set to TRUE, messages are not sent over the network (useful when traces is caused by network errors).

Reimplemented in gbxutilacfr::TrivialTracer.

Referenced by gbxsickacfr::Driver::Driver(), gbxnovatelacfr::Driver::read(), and gbxsmartbatteryacfr::OceanServer::walk().


The documentation for this class was generated from the following file:
 

Generated for GearBox by  doxygen 1.4.5