LogBindingROS.h
Go to the documentation of this file.
00001 #ifndef LOGGER_BINDING_ROS_LOGBINDINGROS_H
00002 #define LOGGER_BINDING_ROS_LOGBINDINGROS_H
00003 
00023 #include <logger_binding/LogBinding.h>
00024 #include <ros/ros.h>
00025 #include <string>
00026 
00027 namespace logger_binding
00028 {
00029 
00036 class ROSLog: public Log
00037 {
00038 protected:
00039     virtual void implPrint(const std::stringstream& str)
00040     {
00041         ROS_INFO_STREAM(str.str());
00042     }
00043     virtual void implPrintError(const std::stringstream& str)
00044     {
00045         ROS_ERROR_STREAM(str.str());
00046     }
00047     virtual void implPrintWarn(const std::stringstream& str)
00048     {
00049         ROS_WARN_STREAM(str.str());
00050     }
00051 
00052     virtual void implPrint(const char* str)
00053     {
00054         ROS_INFO_STREAM(str);
00055     }
00056     virtual void implPrintError(const char* str)
00057     {
00058         ROS_ERROR_STREAM(str);
00059     }
00060     virtual void implPrintWarn(const char* str)
00061     {
00062         ROS_WARN_STREAM(str);
00063     }
00064 
00065     virtual void printNewLine(bool errorStream)
00066     {
00067     }
00068 };
00069 
00070 }  // namespace logger_binding
00071 
00072 
00073 #define PRINT_INIT_ROS() \
00074 {\
00075     if (logger_binding::Log::Singleton) \
00076     { \
00077         std::cerr << "Singleton already set, overwriting!" << std::endl;\
00078     } \
00079     logger_binding::Log::Singleton = logger_binding::Log::LogPtr(new logger_binding::ROSLog()); \
00080 }
00081 
00082 #endif  // LOGGER_BINDING_ROS_LOGBINDINGROS_H


logger_binding
Author(s): Jennifer Buehler
autogenerated on Sat Mar 2 2019 03:21:43