23 #ifndef _GAZEBO_CONSOLE_HH_
24 #define _GAZEBO_CONSOLE_HH_
40 #define gzmsg (gazebo::common::Console::Instance()->ColorMsg("Msg", 32))
43 #define gzdbg (gazebo::common::Console::Instance()->ColorMsg("Dbg", 36))
46 #define gzwarn (gazebo::common::Console::Instance()->ColorErr("Warning", \
47 __FILE__, __LINE__, 33))
50 #define gzerr (gazebo::common::Console::Instance()->ColorErr("Error", \
51 __FILE__, __LINE__, 31))
54 #define gzlog (gazebo::common::Console::Instance()->Log() << "[" <<\
55 __FILE__ << ":" << __LINE__ << "] ")
58 #define gzclr_start(clr) "\033[1;33m"
60 #define gzclr_end "\033[0m"
85 public: std::ostream &
ColorMsg(
const std::string &_lbl,
int _color);
93 public: std::ostream &
ColorErr(
const std::string &_lbl,
94 const std::string &_file,
unsigned int _line,
int _color);
98 public: std::ofstream &
Log();
101 private:
bool logData;
104 private:
class NullStream :
public std::ostream
107 public: NullStream() : std::ios(0), std::ostream(0) {}
111 private: NullStream nullStream;
114 private: std::ostream *msgStream;
117 private: std::ostream *errStream;
120 private: std::ofstream logStream;
123 private:
static Console *myself;