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 
28 namespace gbxutilacfr {
29 
31 enum TraceType {
45 };
46 
48 GBXUTILACFR_EXPORT std::string toString( TraceType type );
49 
65 };
66 
111 class GBXUTILACFR_EXPORT Tracer
112 {
113 public:
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
Error.
Definition: tracer.h:37
TraceType
Types of traced information.
Definition: tracer.h:31
Definition: tracer.h:62
Write to a file.
Definition: tracer.h:59
Debug statement.
Definition: tracer.h:39
Information.
Definition: tracer.h:33
std::string toString(SubsystemState state)
Returns string equivalent of state enumerator.
Definition: status.cpp:17
DestinationType
Types of destinations for traced information.
Definition: tracer.h:51
Warning.
Definition: tracer.h:35
Number of destination types.
Definition: tracer.h:64
Local and remote tracing.
Definition: tracer.h:111
virtual void error(const std::string &message, int level=1, bool localOnly=false)
Definition: tracer.h:149
virtual void setSubsystemDebugLevel(const std::string &subsystem, int level=0)
Definition: tracer.h:171
virtual void subsystemDebug(const std::string &subsystem, const std::string &message, int level=1)
Definition: tracer.h:176
virtual void warning(const std::string &message, int level=1, bool localOnly=false)
Definition: tracer.h:141
ACFR utilities.
Definition: gbxnovatelacfr/driver.h:24
Definition: tracer.h:42
Write to stardard display.
Definition: tracer.h:53
Write to SysLog on Unix, EventLog on windows.
Definition: tracer.h:57
virtual void info(const std::string &message, int level=1, bool localOnly=false)
Definition: tracer.h:133
Send over the network, details are specific to Tracer implementation.
Definition: tracer.h:55
Number of trace types.
Definition: tracer.h:44
virtual void debug(const std::string &message, int level=1, bool localOnly=false)
Definition: tracer.h:157
 

Generated for GearBox by  doxygen 1.4.5