INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
tracer.h
1/*
2 * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
3 * http://!gearbox.sf.net/
4 * Copyright (c) 2004-2010 Alex Brooks, Alexei Makarenko, Tobias Kaupp
5 *
6 * This distribution is licensed to you under the terms described in
7 * the LICENSE file included in this distribution.
8 *
9 */
10
11#ifndef GBXUTILACFR_TRACER_H
12#define GBXUTILACFR_TRACER_H
13
14#if defined (WIN32)
15 #if defined (GBXUTILACFR_STATIC)
16 #define GBXUTILACFR_EXPORT
17 #elif defined (GBXUTILACFR_EXPORTS)
18 #define GBXUTILACFR_EXPORT __declspec (dllexport)
19 #else
20 #define GBXUTILACFR_EXPORT __declspec (dllimport)
21 #endif
22#else
23 #define GBXUTILACFR_EXPORT
24#endif
25
26#include <string>
27
28namespace gbxutilacfr {
29
46
48GBXUTILACFR_EXPORT std::string toString( TraceType type );
49
66
111class GBXUTILACFR_EXPORT Tracer
112{
113public:
114 virtual ~Tracer() {};
115
116 struct Config
117 {
121 bool addTimestamp;
122 };
123
125
128 virtual void print( const std::string &message ) = 0;
129
133 virtual void info( const std::string &message, int level=1, bool localOnly=false )
134 { info("",message,level,localOnly); }
136 virtual void info( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ) = 0;
137
141 virtual void warning( const std::string &message, int level=1, bool localOnly=false )
142 { warning("",message,level,localOnly); }
144 virtual void warning( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ) = 0;
145
149 virtual void error( const std::string &message, int level=1, bool localOnly=false )
150 { error("",message,level,localOnly); }
152 virtual void error( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ) = 0;
153
157 virtual void debug( const std::string &message, int level=1, bool localOnly=false )
158 { debug("",message,level,localOnly); }
160 virtual void debug( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ) = 0;
161
167 virtual int verbosity( TraceType traceType, DestinationType destType=ToAny ) const = 0;
168
171 virtual void setSubsystemDebugLevel( const std::string &subsystem, int level=0 ) {};
172
176 virtual void subsystemDebug( const std::string &subsystem, const std::string &message, int level=1 )
177 {
178 debug( message, level );
179 };
180};
181
182}
183
184#endif
Definition tracer.h:112
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 setSubsystemDebugLevel(const std::string &subsystem, int level=0)
Definition tracer.h:171
virtual void debug(const std::string &message, int level=1, bool localOnly=false)
Definition tracer.h:157
virtual void info(const std::string &message, int level=1, bool localOnly=false)
Definition tracer.h:133
virtual void print(const std::string &message)=0
LOCAL INTERFACE.
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 &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 subsystemDebug(const std::string &subsystem, const std::string &message, int level=1)
Definition tracer.h:176
virtual int verbosity(TraceType traceType, DestinationType destType=ToAny) const =0
virtual void warning(const std::string &message, int level=1, bool localOnly=false)
Definition tracer.h:141
virtual void error(const std::string &message, int level=1, bool localOnly=false)
Definition tracer.h:149
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.
ACFR utilities.
Definition gbxnovatelacfr/driver.h:24
DestinationType
Types of destinations for traced information.
Definition tracer.h:51
@ ToNetwork
Send over the network, details are specific to Tracer implementation.
Definition tracer.h:55
@ ToFile
Write to a file.
Definition tracer.h:59
@ ToAny
Definition tracer.h:62
@ ToDisplay
Write to stardard display.
Definition tracer.h:53
@ ToLog
Write to SysLog on Unix, EventLog on windows.
Definition tracer.h:57
@ NumberOfDestinationTypes
Number of destination types.
Definition tracer.h:64
std::string toString(SubsystemState state)
Returns string equivalent of state enumerator.
Definition status.cpp:17
TraceType
Types of traced information.
Definition tracer.h:31
@ AnyTrace
Definition tracer.h:42
@ WarningTrace
Warning.
Definition tracer.h:35
@ DebugTrace
Debug statement.
Definition tracer.h:39
@ ErrorTrace
Error.
Definition tracer.h:37
@ InfoTrace
Information.
Definition tracer.h:33
@ NumberOfTraceTypes
Number of trace types.
Definition tracer.h:44
 

Generated for GearBox by  doxygen 1.4.5