GazeboMessage.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef GAZEBOMESSAGE_HH
00029 #define GAZEBOMESSAGE_HH
00030
00031 #include <iostream>
00032 #include <fstream>
00033 #include <sstream>
00034
00035 namespace gazebo
00036 {
00037
00041
00043 #define gzmsg(level) (gazebo::GazeboMessage::Instance()->Msg(level) << "[" << __FILE__ << ":" << __LINE__ << "]\n ")
00044
00046 #define gzlog() (gazebo::GazeboMessage::Instance()->Log() << "[" << __FILE__ << ":" << __LINE__ << "] ")
00047
00048 class XMLConfigNode;
00049
00052
00063 class GazeboMessage
00064 {
00066 public: GazeboMessage();
00067
00069 public: virtual ~GazeboMessage();
00070
00072 public: static GazeboMessage *Instance();
00073
00075 public: void Load(XMLConfigNode *node);
00076
00079 public: void SetVerbose( int level );
00080
00083 public: std::ostream &Msg( int level = 0 );
00084
00086 public: std::ofstream &Log();
00087
00089 private: int level;
00090
00091 private: std::ostringstream nullStream;
00092 private: std::ostream *msgStream;
00093 private: std::ofstream logStream;
00094
00096 private: static GazeboMessage *myself;
00097 };
00098
00100 }
00101
00102 #endif