00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <pluginlib/class_list_macros.hpp>
00031 #include <nodelet/nodelet.h>
00032 #include <ros/ros.h>
00033 #include <std_msgs/Float64.h>
00034 #include <stdio.h>
00035
00036
00037 #include <math.h>
00038
00039 namespace test_nodelet
00040 {
00041
00042 class ConsoleTest : public nodelet::Nodelet
00043 {
00044 private:
00045 virtual void onInit()
00046 {
00047 std::string suffix("logger_suffix");
00048
00049 NODELET_DEBUG("DEBUG output");
00050 NODELET_DEBUG_STREAM("DEBUG" << " output");
00051 NODELET_DEBUG_ONCE("DEBUG output");
00052 NODELET_DEBUG_STREAM_ONCE("DEBUG" << " output");
00053 NODELET_DEBUG_COND(1 == 1, "DEBUG output");
00054 NODELET_DEBUG_STREAM_COND(1 == 1, "DEBUG" << " output");
00055 NODELET_DEBUG_COND(1 == 0, "DEBUG output unseen");
00056 NODELET_DEBUG_STREAM_COND(1 == 0, "DEBUG" << " output unseen");
00057 NODELET_DEBUG_THROTTLE(10.0, "DEBUG output");
00058 NODELET_DEBUG_STREAM_THROTTLE(10.0, "DEBUG" << " output");
00059
00060
00061
00062 NODELET_DEBUG_NAMED(suffix, "DEBUG output");
00063 NODELET_DEBUG_STREAM_NAMED(suffix, "DEBUG" << " output");
00064 NODELET_DEBUG_ONCE_NAMED(suffix, "DEBUG output");
00065 NODELET_DEBUG_STREAM_ONCE_NAMED(suffix, "DEBUG" << " output");
00066 NODELET_DEBUG_COND_NAMED(1 == 1, suffix, "DEBUG output");
00067 NODELET_DEBUG_STREAM_COND_NAMED(1 == 1, suffix, "DEBUG" << " output");
00068 NODELET_DEBUG_COND_NAMED(1 == 0, suffix, "DEBUG output unseen");
00069 NODELET_DEBUG_STREAM_COND_NAMED(1 == 0, suffix, "DEBUG" << " output unseen");
00070 NODELET_DEBUG_THROTTLE_NAMED(10.0, suffix, "DEBUG output");
00071 NODELET_DEBUG_STREAM_THROTTLE_NAMED(10.0, suffix, "DEBUG" << " output");
00072
00073
00074
00075
00076 NODELET_INFO("INFO output");
00077 NODELET_INFO_STREAM("INFO" << " output");
00078 NODELET_INFO_ONCE("INFO output");
00079 NODELET_INFO_STREAM_ONCE("INFO" << " output");
00080 NODELET_INFO_COND(1 == 1, "INFO output");
00081 NODELET_INFO_STREAM_COND(1 == 1, "INFO" << " output");
00082 NODELET_INFO_COND(1 == 0, "INFO output unseen");
00083 NODELET_INFO_STREAM_COND(1 == 0, "INFO" << " output unseen");
00084 NODELET_INFO_THROTTLE(10.0, "INFO output");
00085 NODELET_INFO_STREAM_THROTTLE(10.0, "INFO" << " output");
00086
00087
00088
00089 NODELET_INFO_NAMED(suffix, "INFO output");
00090 NODELET_INFO_STREAM_NAMED(suffix, "INFO" << " output");
00091 NODELET_INFO_ONCE_NAMED(suffix, "INFO output");
00092 NODELET_INFO_STREAM_ONCE_NAMED(suffix, "INFO" << " output");
00093 NODELET_INFO_COND_NAMED(1 == 1, suffix, "INFO output");
00094 NODELET_INFO_STREAM_COND_NAMED(1 == 1, suffix, "INFO" << " output");
00095 NODELET_INFO_COND_NAMED(1 == 0, suffix, "INFO output unseen");
00096 NODELET_INFO_STREAM_COND_NAMED(1 == 0, suffix, "INFO" << " output unseen");
00097 NODELET_INFO_THROTTLE_NAMED(10.0, suffix, "INFO output");
00098 NODELET_INFO_STREAM_THROTTLE_NAMED(10.0, suffix, "INFO" << " output");
00099
00100
00101
00102
00103 NODELET_WARN("WARN output");
00104 NODELET_WARN_STREAM("WARN" << " output");
00105 NODELET_WARN_ONCE("WARN output");
00106 NODELET_WARN_STREAM_ONCE("WARN" << " output");
00107 NODELET_WARN_COND(1 == 1, "WARN output");
00108 NODELET_WARN_STREAM_COND(1 == 1, "WARN" << " output");
00109 NODELET_WARN_COND(1 == 0, "WARN output unseen");
00110 NODELET_WARN_STREAM_COND(1 == 0, "WARN" << " output unseen");
00111 NODELET_WARN_THROTTLE(10.0, "WARN output");
00112 NODELET_WARN_STREAM_THROTTLE(10.0, "WARN" << " output");
00113
00114
00115
00116 NODELET_WARN_NAMED(suffix, "WARN output");
00117 NODELET_WARN_STREAM_NAMED(suffix, "WARN" << " output");
00118 NODELET_WARN_ONCE_NAMED(suffix, "WARN output");
00119 NODELET_WARN_STREAM_ONCE_NAMED(suffix, "WARN" << " output");
00120 NODELET_WARN_COND_NAMED(1 == 1, suffix, "WARN output");
00121 NODELET_WARN_STREAM_COND_NAMED(1 == 1, suffix, "WARN" << " output");
00122 NODELET_WARN_COND_NAMED(1 == 0, suffix, "WARN output unseen");
00123 NODELET_WARN_STREAM_COND_NAMED(1 == 0, suffix, "WARN" << " output unseen");
00124 NODELET_WARN_THROTTLE_NAMED(10.0, suffix, "WARN output");
00125 NODELET_WARN_STREAM_THROTTLE_NAMED(10.0, suffix, "WARN" << " output");
00126
00127
00128
00129
00130 NODELET_ERROR("ERROR output");
00131 NODELET_ERROR_STREAM("ERROR" << " output");
00132 NODELET_ERROR_ONCE("ERROR output");
00133 NODELET_ERROR_STREAM_ONCE("ERROR" << " output");
00134 NODELET_ERROR_COND(1 == 1, "ERROR output");
00135 NODELET_ERROR_STREAM_COND(1 == 1, "ERROR" << " output");
00136 NODELET_ERROR_COND(1 == 0, "ERROR output unseen");
00137 NODELET_ERROR_STREAM_COND(1 == 0, "ERROR" << " output unseen");
00138 NODELET_ERROR_THROTTLE(10.0, "ERROR output");
00139 NODELET_ERROR_STREAM_THROTTLE(10.0, "ERROR" << " output");
00140
00141
00142
00143 NODELET_ERROR_NAMED(suffix, "ERROR output");
00144 NODELET_ERROR_STREAM_NAMED(suffix, "ERROR" << " output");
00145 NODELET_ERROR_ONCE_NAMED(suffix, "ERROR output");
00146 NODELET_ERROR_STREAM_ONCE_NAMED(suffix, "ERROR" << " output");
00147 NODELET_ERROR_COND_NAMED(1 == 1, suffix, "ERROR output");
00148 NODELET_ERROR_STREAM_COND_NAMED(1 == 1, suffix, "ERROR" << " output");
00149 NODELET_ERROR_COND_NAMED(1 == 0, suffix, "ERROR output unseen");
00150 NODELET_ERROR_STREAM_COND_NAMED(1 == 0, suffix, "ERROR" << " output unseen");
00151 NODELET_ERROR_THROTTLE_NAMED(10.0, suffix, "ERROR output");
00152 NODELET_ERROR_STREAM_THROTTLE_NAMED(10.0, suffix, "ERROR" << " output");
00153
00154
00155
00156
00157 NODELET_FATAL("FATAL output");
00158 NODELET_FATAL_STREAM("FATAL" << " output");
00159 NODELET_FATAL_ONCE("FATAL output");
00160 NODELET_FATAL_STREAM_ONCE("FATAL" << " output");
00161 NODELET_FATAL_COND(1 == 1, "FATAL output");
00162 NODELET_FATAL_STREAM_COND(1 == 1, "FATAL" << " output");
00163 NODELET_FATAL_COND(1 == 0, "FATAL output unseen");
00164 NODELET_FATAL_STREAM_COND(1 == 0, "FATAL" << " output unseen");
00165 NODELET_FATAL_THROTTLE(10.0, "FATAL output");
00166 NODELET_FATAL_STREAM_THROTTLE(10.0, "FATAL" << " output");
00167
00168
00169
00170 NODELET_FATAL_NAMED(suffix, "FATAL output");
00171 NODELET_FATAL_STREAM_NAMED(suffix, "FATAL" << " named output");
00172 NODELET_FATAL_ONCE_NAMED(suffix, "FATAL named output");
00173 NODELET_FATAL_STREAM_ONCE_NAMED(suffix, "FATAL" << " named output");
00174 NODELET_FATAL_COND_NAMED(1 == 1, suffix, "FATAL named output");
00175 NODELET_FATAL_STREAM_COND_NAMED(1 == 1, suffix, "FATAL" << " named output");
00176 NODELET_FATAL_COND_NAMED(1 == 0, suffix, "FATAL named output unseen");
00177 NODELET_FATAL_STREAM_COND_NAMED(1 == 0, suffix, "FATAL" << " named output unseen");
00178 NODELET_FATAL_THROTTLE_NAMED(10.0, suffix, "FATAL named output");
00179 NODELET_FATAL_STREAM_THROTTLE_NAMED(10.0, suffix, "FATAL" << " named output");
00180
00181
00182
00183 }
00184
00185 };
00186
00187 PLUGINLIB_EXPORT_CLASS(test_nodelet::ConsoleTest, nodelet::Nodelet)
00188 }