INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
simpletracer.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef HYDROICEUTIL_SIMPLE_TRACER_H 00012 #define HYDROICEUTIL_SIMPLE_TRACER_H 00013 00014 #include <gbxutilacfr/tracer.h> 00015 #include <IceUtil/Mutex.h> 00016 00017 namespace hydroiceutil 00018 { 00019 00024 class SimpleTracer : public gbxutilacfr::Tracer 00025 { 00026 public: 00028 SimpleTracer( const std::string& sysName="Tracer" ); 00029 00031 virtual void print( const std::string &message ); 00033 virtual void info( const std::string &message, int level=1, bool localOnly=false ) 00034 { info("",message,level,localOnly); } 00036 virtual void warning( const std::string &message, int level=1, bool localOnly=false ) 00037 { warning("",message,level,localOnly); } 00039 virtual void error( const std::string &message, int level=1, bool localOnly=false ) 00040 { error("",message,level,localOnly); } 00042 virtual void debug( const std::string &message, int level=1, bool localOnly=false ) 00043 { debug("",message,level,localOnly); } 00045 virtual int verbosity( gbxutilacfr::TraceType traceType, gbxutilacfr::DestinationType destType ) const; 00046 00047 virtual void info( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ); 00048 virtual void warning( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ); 00049 virtual void error( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ); 00050 virtual void debug( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ); 00051 00052 private: 00053 // a string to prepend to all trace messages 00054 std::string prefix_; 00055 00056 // custom outgoing commands 00057 void toDisplay( gbxutilacfr::TraceType traceType, 00058 const std::string& message, 00059 int level, 00060 const std::string &subsystem ); 00061 00062 // utilities 00063 std::string assembleMessage( gbxutilacfr::TraceType traceType, 00064 const std::string &message, 00065 const std::string &subsystem, 00066 int level ); 00067 00068 // Tracer may be called from multiple threads. 00069 IceUtil::Mutex mutex_; 00070 }; 00071 00072 } // namespace 00073 00074 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)