XBotInterface
2.4.1
XBotInterface provides a generic API to model and control a robot.
|
#include <RtLog.hpp>
Public Types | |
typedef std::shared_ptr< LoggerClass > | Ptr |
typedef std::function< void(char *, int, Logger::Severity)> | OnPrintCallback |
Public Member Functions | |
LoggerClass (std::string logger_name) | |
LoggerClass (std::string logger_name, OnPrintCallback f) | |
~LoggerClass () | |
std::ostream & | log () |
Writes to the internal stream with no special formatting and without changing the severity level (which defaults to HIGH). More... | |
std::ostream & | info (Logger::Severity s=Logger::Severity::LOW) |
Logs an information message (with bold [INFO] header). More... | |
void | info (Logger::Severity s, const char *fmt,...) |
Logs an information message (with bold [INFO] header). More... | |
void | info (const char *fmt,...) |
Logs an information message (with bold [INFO] header). More... | |
std::ostream & | error (Logger::Severity s=Logger::Severity::HIGH) |
Logs an error message (in red, with bold [ERROR] header). More... | |
void | error (Logger::Severity s, const char *fmt,...) |
Logs an error message (with bold [ERROR] header). More... | |
void | error (const char *fmt,...) |
Logs an error message (with bold [ERROR] header). More... | |
std::ostream & | warning (Logger::Severity s=Logger::Severity::MID) |
Logs a warning message (in yellow, with bold [WARNING] header). More... | |
void | warning (Logger::Severity s, const char *fmt,...) |
Logs an warning message (with bold [warning] header). More... | |
void | warning (const char *fmt,...) |
Logs an warning message (with bold [warning] header). More... | |
std::ostream & | success (Logger::Severity s=Logger::Severity::LOW) |
Logs a success message (in green, with bold [OK] header). More... | |
void | success (Logger::Severity s, const char *fmt,...) |
Logs a success message (with bold [success] header). More... | |
void | success (const char *fmt,...) |
Logs a success message (with bold [success] header). More... | |
Endl & | endl () |
Closes the message and prints to screen. More... | |
void | setVerbosityLevel (Logger::Severity s) |
Sets the global verbosity level, i.e. More... | |
Logger::Severity | getVerbosityLevel () const |
Sets the global verbosity level, i.e. More... | |
void | setOnPrintCallback (std::function< void(char *, int, Logger::Severity)> f) |
Sets the on print callback. More... | |
Static Public Member Functions | |
static void | DefaultOnPrint (char *, int, Logger::Severity) |
Friends | |
class | Endl |
class | Logger |
Logger class.
typedef std::function<void(char*, int, Logger::Severity)> XBot::LoggerClass::OnPrintCallback |
typedef std::shared_ptr<LoggerClass> XBot::LoggerClass::Ptr |
XBot::LoggerClass::LoggerClass | ( | std::string | logger_name | ) |
XBot::LoggerClass::LoggerClass | ( | std::string | logger_name, |
OnPrintCallback | f | ||
) |
XBot::LoggerClass::~LoggerClass | ( | ) |
|
static |
Endl & XBot::LoggerClass::endl | ( | ) |
Closes the message and prints to screen.
void XBot::LoggerClass::error | ( | const char * | fmt, |
... | |||
) |
Logs an error message (with bold [ERROR] header).
fmt | Formatted string (printf-like) |
void XBot::LoggerClass::error | ( | Logger::Severity | s, |
const char * | fmt, | ||
... | |||
) |
Logs an error message (with bold [ERROR] header).
s | Message severity. Defaults to HIGH. |
fmt | Formatted string (printf-like) |
... | Values for the formatted string (printf-like) |
std::ostream & XBot::LoggerClass::error | ( | Logger::Severity | s = Logger::Severity::HIGH | ) |
Logs an error message (in red, with bold [ERROR] header).
s | Message severity. Defaults to HIGH. |
Logger::Severity XBot::LoggerClass::getVerbosityLevel | ( | ) | const |
Sets the global verbosity level, i.e.
the minimum severity that a message must have in order to actually be printed.
void XBot::LoggerClass::info | ( | const char * | fmt, |
... | |||
) |
Logs an information message (with bold [INFO] header).
fmt | Formatted string (printf-like) |
void XBot::LoggerClass::info | ( | Logger::Severity | s, |
const char * | fmt, | ||
... | |||
) |
Logs an information message (with bold [INFO] header).
s | Message severity. Defaults to LOW. |
fmt | Formatted string (printf-like) |
... | Values for the formatted string (printf-like) |
std::ostream & XBot::LoggerClass::info | ( | Logger::Severity | s = Logger::Severity::LOW | ) |
Logs an information message (with bold [INFO] header).
s | Message severity. Defaults to LOW. |
std::ostream & XBot::LoggerClass::log | ( | ) |
Writes to the internal stream with no special formatting and without changing the severity level (which defaults to HIGH).
void XBot::LoggerClass::setOnPrintCallback | ( | std::function< void(char *, int, Logger::Severity)> | f | ) |
Sets the on print callback.
The user can customize the printing behavior by providing a custom function to the underlying logger.
void XBot::LoggerClass::setVerbosityLevel | ( | Logger::Severity | s | ) |
Sets the global verbosity level, i.e.
the minimum severity that a message must have in order to actually be printed.
void XBot::LoggerClass::success | ( | const char * | fmt, |
... | |||
) |
Logs a success message (with bold [success] header).
fmt | Formatted string (printf-like) |
void XBot::LoggerClass::success | ( | Logger::Severity | s, |
const char * | fmt, | ||
... | |||
) |
Logs a success message (with bold [success] header).
s | Message severity. Defaults to LOW. |
fmt | Formatted string (printf-like) |
... | Values for the formatted string (printf-like) |
std::ostream & XBot::LoggerClass::success | ( | Logger::Severity | s = Logger::Severity::LOW | ) |
Logs a success message (in green, with bold [OK] header).
s | Message severity. Defaults to LOW. |
void XBot::LoggerClass::warning | ( | const char * | fmt, |
... | |||
) |
Logs an warning message (with bold [warning] header).
fmt | Formatted string (printf-like) |
void XBot::LoggerClass::warning | ( | Logger::Severity | s, |
const char * | fmt, | ||
... | |||
) |
Logs an warning message (with bold [warning] header).
s | Message severity. Defaults to MEDIUM. |
fmt | Formatted string (printf-like) |
... | Values for the formatted string (printf-like) |
std::ostream & XBot::LoggerClass::warning | ( | Logger::Severity | s = Logger::Severity::MID | ) |
Logs a warning message (in yellow, with bold [WARNING] header).
s | Message severity. Defaults to MEDIUM. |
|
friend |
|
friend |