INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
trivialtracer.h00001 /* 00002 * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics 00003 * http://gearbox.sf.net/ 00004 * Copyright (c) 2004-2010 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 GBXUTILACFR_TRIVIAL_TRACER_H 00012 #define GBXUTILACFR_TRIVIAL_TRACER_H 00013 00014 #if defined (WIN32) 00015 #if defined (GBXUTILACFR_STATIC) 00016 #define GBXUTILACFR_EXPORT 00017 #elif defined (GBXUTILACFR_EXPORTS) 00018 #define GBXUTILACFR_EXPORT __declspec (dllexport) 00019 #else 00020 #define GBXUTILACFR_EXPORT __declspec (dllimport) 00021 #endif 00022 #else 00023 #define GBXUTILACFR_EXPORT 00024 #endif 00025 00026 #include <gbxutilacfr/tracer.h> 00027 00028 namespace gbxutilacfr { 00029 00035 class GBXUTILACFR_EXPORT TrivialTracer : public Tracer 00036 { 00037 public: 00038 00042 TrivialTracer( int debug=0, 00043 int info=9, 00044 int warn=9, 00045 int error=9 ); 00046 00047 virtual void print( const std::string &message ); 00048 virtual void info( const std::string &message, int level=1, bool localOnly=false ) 00049 { info("",message,level,localOnly); } 00050 virtual void warning( const std::string &message, int level=1, bool localOnly=false ) 00051 { warning("",message,level,localOnly); } 00052 virtual void error( const std::string &message, int level=1, bool localOnly=false ) 00053 { error("",message,level,localOnly); } 00054 virtual void debug( const std::string &message, int level=1, bool localOnly=false ) 00055 { debug("",message,level,localOnly); } 00056 virtual int verbosity( TraceType traceType, DestinationType destType=ToAny ) const; 00057 00058 virtual void info( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ); 00059 virtual void warning( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ); 00060 virtual void error( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ); 00061 virtual void debug( const std::string &subsystem, const std::string &message, int level=1, bool localOnly=false ); 00062 00063 private: 00064 00065 int traceLevels_[NumberOfTraceTypes]; 00066 }; 00067 00068 } // namespace 00069 00070 #endif |