18 #ifndef _GAZEBO_CONSOLE_HH_
19 #define _GAZEBO_CONSOLE_HH_
26 #include <boost/thread.hpp>
38 #define gzmsg (gazebo::common::Console::msg())
41 #define gzdbg (gazebo::common::Console::dbg(__FILE__, __LINE__))
44 #define gzwarn (gazebo::common::Console::warn(__FILE__, __LINE__))
47 #define gzerr (gazebo::common::Console::err(__FILE__, __LINE__))
50 #define gzlog (gazebo::common::Console::log())
56 #define gzLogInit(_str) (gazebo::common::Console::log.Init(_str))
65 public:
FileLogger(
const std::string &_filename =
"");
73 public:
void Init(
const std::string &_filename);
86 const std::string &_file,
int _line);
89 protected:
class Buffer :
public std::stringbuf
93 public:
Buffer(
const std::string &_filename);
101 public:
virtual int sync();
126 public:
Logger(
const std::string &_prefix,
int _color, LogType _type);
129 public:
virtual ~
Logger();
133 public:
virtual Logger &operator()();
140 public:
virtual Logger &operator()(
141 const std::string &_file,
int _line);
144 protected:
class Buffer :
public std::stringbuf
153 public:
virtual ~
Buffer();
158 public:
virtual int sync();
173 private: std::string prefix;
183 public:
static void SetQuiet(
bool _q);
187 public:
static bool GetQuiet();
205 private:
static bool quiet;
Terminal logger.
Definition: Console.hh:110
LogType type
Destination type for the messages.
Definition: Console.hh:161
static Logger msg
Global instance of the message logger.
Definition: Console.hh:190
Output to stdout.
Definition: Console.hh:117
int color
ANSI color code using Select Graphic Rendition parameters (SGR).
Definition: Console.hh:166
static Logger dbg
Global instance of the debug logger.
Definition: Console.hh:196
String buffer for the base logger.
Definition: Console.hh:144
Container for loggers, and global logging options (such as verbose vs.
Definition: Console.hh:179
std::ofstream * stream
Stream to output information into.
Definition: Console.hh:104
static FileLogger log
Global instance of the file logger.
Definition: Console.hh:202
A logger that outputs messages to a file.
Definition: Console.hh:60
static Logger err
Global instance of the error logger.
Definition: Console.hh:193
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
LogType
Definition: Console.hh:114
String buffer for the file logger.
Definition: Console.hh:89
static Logger warn
Global instance of the warning logger.
Definition: Console.hh:199
int color
Color for the output.
Definition: Console.hh:170
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48