37 #ifndef JSK_TOPIC_TOOLS_LOG_UTILS_H_ 38 #define JSK_TOPIC_TOOLS_LOG_UTILS_H_ 52 bool warnNoRemap(
const std::vector<std::string> names);
64 #define JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX() \ 65 ROS_WARN_ONCE("DEPRECATION WARNING: JSK_NODELET_XXX log macros are deprecated, and please use NODELET_XXX instead." \ 66 " (See https://github.com/jsk-ros-pkg/jsk_common/issues/1461)"); 67 #define JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX() \ 68 ROS_WARN_ONCE("DEPRECATION WARNING: JSK_ROS_XXX log utils are deprecated, and please use ROS_XXX instead." \ 69 " (See https://github.com/jsk-ros-pkg/jsk_common/issues/1461)"); 71 #define JSK_NODELET_DEBUG(str,...) \ 72 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 73 NODELET_DEBUG("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 74 #define JSK_NODELET_INFO(str,...) \ 75 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 76 NODELET_INFO("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 77 #define JSK_NODELET_WARN(str,...) \ 78 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 79 NODELET_WARN("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 80 #define JSK_NODELET_ERROR(str,...) \ 81 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 82 NODELET_ERROR("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 83 #define JSK_NODELET_FATAL(str,...) \ 84 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 85 NODELET_FATAL("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 87 #define JSK_NODELET_DEBUG_STREAM(...) \ 88 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 89 NODELET_DEBUG_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 90 #define JSK_NODELET_INFO_STREAM(...) \ 91 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 92 NODELET_INFO_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 93 #define JSK_NODELET_WARN_STREAM(...) \ 94 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 95 NODELET_WARN_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 96 #define JSK_NODELET_ERROR_STREAM(...) \ 97 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 98 NODELET_ERROR_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 99 #define JSK_NODELET_FATAL_STREAM(...) \ 100 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 101 NODELET_FATAL_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 103 #define JSK_NODELET_DEBUG_THROTTLE(rate, str, ...) \ 104 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 105 NODELET_DEBUG_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 106 #define JSK_NODELET_INFO_THROTTLE(rate, str, ...) \ 107 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 108 NODELET_INFO_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 109 #define JSK_NODELET_WARN_THROTTLE(rate, str, ...) \ 110 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 111 NODELET_WARN_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 112 #define JSK_NODELET_ERROR_THROTTLE(rate, str, ...) \ 113 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 114 NODELET_ERROR_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 115 #define JSK_NODELET_FATAL_THROTTLE(rate, str, ...) \ 116 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 117 NODELET_FATAL_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 119 #define JSK_NODELET_DEBUG_STREAM_THROTTLE(rate,...) \ 120 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 121 NODELET_DEBUG_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 122 #define JSK_NODELET_INFO_STREAM_THROTTLE(rate,...) \ 123 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 124 NODELET_INFO_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 125 #define JSK_NODELET_WARN_STREAM_THROTTLE(rate,...) \ 126 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 127 NODELET_WARN_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 128 #define JSK_NODELET_ERROR_STREAM_THROTTLE(rate,...) \ 129 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 130 NODELET_ERROR_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 131 #define JSK_NODELET_FATAL_STREAM_THROTTLE(rate,...) \ 132 JSK_TOPIC_TOOLS_DEPRECATED_JSK_NODELET_XXX(); \ 133 NODELET_FATAL_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 135 #define JSK_ROS_DEBUG(str,...) \ 136 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 137 ROS_DEBUG("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 138 #define JSK_ROS_INFO(str,...) \ 139 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 140 ROS_INFO("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 141 #define JSK_ROS_WARN(str,...) \ 142 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 143 ROS_WARN("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 144 #define JSK_ROS_ERROR(str,...) \ 145 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 146 ROS_ERROR("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 147 #define JSK_ROS_FATAL(str,...) \ 148 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 149 ROS_FATAL("[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 151 #define JSK_ROS_DEBUG_STREAM(...) \ 152 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 153 ROS_DEBUG_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 154 #define JSK_ROS_INFO_STREAM(...) \ 155 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 156 ROS_INFO_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 157 #define JSK_ROS_WARN_STREAM(...) \ 158 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 159 ROS_WARN_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 160 #define JSK_ROS_ERROR_STREAM(...) \ 161 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 162 ROS_ERROR_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 163 #define JSK_ROS_FATAL_STREAM(...) \ 164 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 165 ROS_FATAL_STREAM("[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 167 #define JSK_ROS_DEBUG_THROTTLE(rate, str, ...) \ 168 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 169 ROS_DEBUG_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 170 #define JSK_ROS_INFO_THROTTLE(rate, str, ...) \ 171 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 172 ROS_INFO_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 173 #define JSK_ROS_WARN_THROTTLE(rate, str, ...) \ 174 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 175 ROS_WARN_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 176 #define JSK_ROS_ERROR_THROTTLE(rate, str, ...) \ 177 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 178 ROS_ERROR_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 179 #define JSK_ROS_FATAL_THROTTLE(rate, str, ...) \ 180 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 181 ROS_FATAL_THROTTLE(rate, "[%s] " str, jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str(), ##__VA_ARGS__) 183 #define JSK_ROS_DEBUG_STREAM_THROTTLE(rate,...) \ 184 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 185 ROS_DEBUG_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 186 #define JSK_ROS_INFO_STREAM_THROTTLE(rate,...) \ 187 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 188 ROS_INFO_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 189 #define JSK_ROS_WARN_STREAM_THROTTLE(rate,...) \ 190 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 191 ROS_WARN_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 192 #define JSK_ROS_ERROR_STREAM_THROTTLE(rate,...) \ 193 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 194 ROS_ERROR_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__) 195 #define JSK_ROS_FATAL_STREAM_THROTTLE(rate,...) \ 196 JSK_TOPIC_TOOLS_DEPRECATED_JSK_ROS_XXX(); \ 197 ROS_FATAL_STREAM_THROTTLE(rate, "[" << jsk_topic_tools::getFunctionName(__PRETTY_FUNCTION__).c_str() << "] " << __VA_ARGS__)