XBotInterface
2.4.1
XBotInterface provides a generic API to model and control a robot.
|
Go to the documentation of this file.
20 #ifndef __XBOT_RT_LOGGER_HPP__
21 #define __XBOT_RT_LOGGER_HPP__
30 #include <boost/iostreams/stream.hpp>
31 #include <boost/iostreams/device/array.hpp>
37 std::ostream&
bold_on(std::ostream& os);
39 std::ostream&
bold_off(std::ostream& os);
43 std::ostream&
color_red(std::ostream& os);
92 static std::ostream&
log();
116 static void info(
const char * fmt, ...);
140 static void error(
const char * fmt, ...);
164 static void warning(
const char * fmt, ...);
188 static void success(
const char * fmt, ...);
238 typedef std::shared_ptr<LoggerClass>
Ptr;
279 void info(
const char * fmt, ...);
303 void error(
const char * fmt, ...);
327 void warning(
const char * fmt, ...);
351 void success(
const char * fmt, ...);
381 typedef boost::iostreams::stream<boost::iostreams::array_sink> ostream_t;
391 void __fmt_print(
const char * fmt, va_list args);
393 static const int BUFFER_SIZE = 4096;
395 char _buffer[BUFFER_SIZE];
401 std::string _name, _name_tag;
std::ostream & bold_off(std::ostream &os)
Definition: RtLog.cpp:177
LoggerClass(std::string logger_name)
Definition: RtLog.cpp:219
std::ostream & color_red(std::ostream &os)
Definition: RtLog.cpp:187
static Endl & endl()
Closes the message and prints to screen.
Definition: RtLog.cpp:107
static Logger::Severity GetVerbosityLevel()
Sets the global verbosity level, i.e.
Definition: RtLog.cpp:161
std::ostream & error(Logger::Severity s=Logger::Severity::HIGH)
Logs an error message (in red, with bold [ERROR] header).
Definition: RtLog.cpp:333
static std::ostream & info(Logger::Severity s=Logger::Severity::LOW)
Logs an information message (with bold [INFO] header).
Definition: RtLog.cpp:112
static void SetVerbosityLevel(Logger::Severity s)
Sets the global verbosity level, i.e.
Definition: RtLog.cpp:146
static std::ostream & error(Logger::Severity s=Logger::Severity::HIGH)
Logs an error message (in red, with bold [ERROR] header).
Definition: RtLog.cpp:41
static void SetOnPrintCallback(std::function< void(char *, int, Logger::Severity)> f)
Sets the on print callback.
Definition: RtLog.cpp:166
std::ostream & color_yellow(std::ostream &os)
Definition: RtLog.cpp:192
Logger class.
Definition: RtLog.hpp:230
static std::ostream & warning(Logger::Severity s=Logger::Severity::MID)
Logs a warning message (in yellow, with bold [warning] header).
Definition: RtLog.cpp:156
Severity
Definition: RtLog.hpp:84
static std::ostream & success(Logger::Severity s=Logger::Severity::LOW)
Logs a success message (in green, with bold [OK] header).
Definition: RtLog.cpp:151
std::ostream & color_green(std::ostream &os)
Definition: RtLog.cpp:182
static void DefaultOnPrint(char *, int, Logger::Severity)
Definition: RtLog.cpp:213
void setVerbosityLevel(Logger::Severity s)
Sets the global verbosity level, i.e.
Definition: RtLog.cpp:458
std::ostream & warning(Logger::Severity s=Logger::Severity::MID)
Logs a warning message (in yellow, with bold [WARNING] header).
Definition: RtLog.cpp:374
friend void operator<<(std::ostream &os, Endl &endl)
Definition: RtLog.cpp:259
std::ostream & info(Logger::Severity s=Logger::Severity::LOW)
Logs an information message (with bold [INFO] header).
Definition: RtLog.cpp:280
static std::ostream & log()
Writes to the internal stream with no special formatting and without changing the severity level (whi...
Definition: RtLog.cpp:140
Endl & endl()
Closes the message and prints to screen.
Definition: RtLog.cpp:455
std::shared_ptr< LoggerClass > Ptr
Definition: RtLog.hpp:238
std::ostream & color_reset(std::ostream &os)
Definition: RtLog.cpp:197
std::ostream & success(Logger::Severity s=Logger::Severity::LOW)
Logs a success message (in green, with bold [OK] header).
Definition: RtLog.cpp:413
void setOnPrintCallback(std::function< void(char *, int, Logger::Severity)> f)
Sets the on print callback.
Definition: RtLog.cpp:470
std::ostream & bold_on(std::ostream &os)
Definition: RtLog.cpp:172
std::function< void(char *, int, Logger::Severity)> OnPrintCallback
Definition: RtLog.hpp:240
~LoggerClass()
Definition: RtLog.cpp:246
Class handling the flushing of log messages to console.
Definition: RtLog.hpp:60
Logger::Severity getVerbosityLevel() const
Sets the global verbosity level, i.e.
Definition: RtLog.cpp:463
Definition: IXBotModel.h:20
std::ostream & log()
Writes to the internal stream with no special formatting and without changing the severity level (whi...
Definition: RtLog.cpp:271