pax_global_header00006660000000000000000000000064125330277330014517gustar00rootroot0000000000000052 comment=f0a653d13d7a862fdf47959e63e92a6e6b1c20f0 ros-rosconsole-bridge-0.4.2/000077500000000000000000000000001253302773300157435ustar00rootroot00000000000000ros-rosconsole-bridge-0.4.2/CHANGELOG.rst000066400000000000000000000052761253302773300177760ustar00rootroot00000000000000^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Changelog for package rosconsole_bridge ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 0.4.2 (2014-07-18) ------------------ * update maintainers 0.4.1 (2014-06-25) ------------------ * update find_package for console bridge to reflect 3rdparty status (`#8 `_) 0.4.0 (2014-06-24) ------------------ * rename variables within rosconsole macros (`ros/ros_comm#442 `_) * convert to use console bridge from upstream debian package (`ros/rosdistro#4633 `_) 0.3.4 (2014-02-15) ------------------ * Allows non-ros components to utilize the prefix functionality of log4j * Contributors: Dave Coleman, Ioan A Sucan 0.3.3 (2013-08-21) ------------------ * fixing catkin as a buildtool dependency * Contributors: Dirk Thomas, Tully Foote 0.3.2 (2013-04-12) ------------------ * changes due to renames in console_bridge * Contributors: Ioan Sucan 0.3.1 (2013-03-13 21:24) ------------------------ * fix deps * update e-mail address * Contributors: Ioan Sucan 0.3.0 (2013-03-13 19:39) ------------------------ 0.2.7 (2013-06-12) ------------------ * changes due to renames in console_bridge * Create README.md * Updated package xml to be more compliant to spec as well as adding maintainer * Contributors: Ioan Sucan, Mirza Shah, isucan 0.2.6 (2012-12-10) ------------------ * update log level * Fixing style issues in CMakeLists.txt * Contributors: Ioan Sucan, William Woodall 0.2.5 (2012-12-05) ------------------ * Update cmake to pass along console_bridge Also changed it to depend on console_bridge like a catkin dependency. * Added tag 0.2.4 for changeset e9f39dd361bf * Contributors: Ioan Sucan, William Woodall, isucan 0.2.4 (2012-10-18) ------------------ * updates to package.xml * Added tag 0.2.3 for changeset 63015a123bb7 * Contributors: Ioan Sucan, Tully Foote 0.2.3 (2012-10-06 23:24) ------------------------ * removing outdated install rule * Added tag 0.2.2 for changeset 3fb270551aee * Contributors: Tully Foote 0.2.2 (2012-10-06 18:49) ------------------------ * fixing depend tags * Added tag 0.2.1 for changeset d4cfe2aea73d * Contributors: Tully Foote 0.2.1 (2012-10-06 16:59) ------------------------ * converting to package.xml from stack.xml, and dropping manifest * Added tag 0.2.0 for changeset 25da297e8ddb * Contributors: Ioan Sucan, Tully Foote 0.2.0 (2012-09-02) ------------------ * update stack version * patches for groovy * Added tag fuerte for changeset f05a07a4dc8c * Added tag 0.1.0 for changeset 119bd5db978d * Contributors: Ioan Sucan 0.1.0 (2012-07-02 11:15) ------------------------ * first commit * Contributors: Ioan Sucan ros-rosconsole-bridge-0.4.2/CMakeLists.txt000066400000000000000000000013501253302773300205020ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.8.3) project(rosconsole_bridge) find_package(console_bridge REQUIRED) find_package(catkin REQUIRED COMPONENTS rosconsole) include_directories(include ${catkin_INCLUDE_DIRS} ${console_bridge_INCLUDE_DIRS}) link_directories(${catkin_LIBRARY_DIRS} ${console_bridge_LIBRARY_DIRS}) catkin_package( INCLUDE_DIRS include LIBRARIES ${PROJECT_NAME} CATKIN_DEPENDS rosconsole DEPENDS console_bridge ) add_library(${PROJECT_NAME} src/bridge.cpp) target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${console_bridge_LIBRARIES}) install( TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h" ) ros-rosconsole-bridge-0.4.2/README.md000066400000000000000000000002151253302773300172200ustar00rootroot00000000000000rosconsole_bridge ================= Pipes console_bridge output to rosconsole/rosout when console_bridge is used in a ROS-dependent package ros-rosconsole-bridge-0.4.2/include/000077500000000000000000000000001253302773300173665ustar00rootroot00000000000000ros-rosconsole-bridge-0.4.2/include/rosconsole_bridge/000077500000000000000000000000001253302773300230705ustar00rootroot00000000000000ros-rosconsole-bridge-0.4.2/include/rosconsole_bridge/bridge.h000066400000000000000000000045261253302773300245040ustar00rootroot00000000000000/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2011, Willow Garage, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the Willow Garage nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /* Author: Ioan Sucan */ #ifndef ROSCONSOLE_BRIDGE_ #define ROSCONSOLE_BRIDGE_ #include namespace rosconsole_bridge { class OutputHandlerROS : public console_bridge::OutputHandler { public: OutputHandlerROS(void); virtual void log(const std::string &text, console_bridge::LogLevel level, const char *filename, int line); }; struct RegisterOutputHandlerProxy { RegisterOutputHandlerProxy(void); }; } #define REGISTER_ROSCONSOLE_BRIDGE \ static rosconsole_bridge::RegisterOutputHandlerProxy __register_rosconsole_output_handler_proxy #endif ros-rosconsole-bridge-0.4.2/package.xml000066400000000000000000000016501253302773300200620ustar00rootroot00000000000000 rosconsole_bridge 0.4.2 rosconsole_bridge is a package used in conjunction with console_bridge and rosconsole for connecting console_bridge-based logging to rosconsole-based logging. Ioan Sucan Dirk Thomas Ioan Sucan BSD http://www.ros.org/wiki/rosconsole_bridge https://github.com/ros/rosconsole_bridge/issues https://github.com/ros/rosconsole_bridge catkin libconsole-bridge-dev rosconsole libconsole-bridge-dev rosconsole ros-rosconsole-bridge-0.4.2/src/000077500000000000000000000000001253302773300165325ustar00rootroot00000000000000ros-rosconsole-bridge-0.4.2/src/bridge.cpp000066400000000000000000000117571253302773300205050ustar00rootroot00000000000000/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2011, Willow Garage, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the Willow Garage nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /* Author: Ioan Sucan */ #include #include #include "rosconsole_bridge/bridge.h" namespace rosconsole_bridge { OutputHandlerROS::OutputHandlerROS(void) : OutputHandler() { } void OutputHandlerROS::log(const std::string &text, console_bridge::LogLevel level, const char *filename, int line) { std::string prefix; // Check for fake subprefix name defined as text output "package.prefix: message" // Rejects something like "foo bar: message" because of the space static const std::string NEEDLE_STRING = ": "; size_t sub_index = text.find(NEEDLE_STRING); size_t space_index = text.find(" "); if (sub_index != std::string::npos && // needle is found sub_index > 0 && // does not start with needle space_index > sub_index && // no spaces before needle (": ") text.length() > space_index + 1) // remaining text is not empty { prefix = std::string(ROSCONSOLE_NAME_PREFIX) + "." + text.substr(0, sub_index); // update the sub_index to allow us to later remove the prefix from the message sub_index += NEEDLE_STRING.length(); } else { prefix = std::string(ROSCONSOLE_NAME_PREFIX) + ".console_bridge"; sub_index = 0; } // Handle different logging levels switch (level) { case console_bridge::CONSOLE_BRIDGE_LOG_INFO: { ROSCONSOLE_DEFINE_LOCATION(true, ::ros::console::levels::Info, prefix); if (ROS_UNLIKELY(__rosconsole_define_location__enabled)) { ::ros::console::print(NULL, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, filename, line, "", "%s", text.substr(sub_index, std::string::npos).c_str()); } } break; case console_bridge::CONSOLE_BRIDGE_LOG_WARN: { ROSCONSOLE_DEFINE_LOCATION(true, ::ros::console::levels::Warn, prefix); if (ROS_UNLIKELY(__rosconsole_define_location__enabled)) { ::ros::console::print(NULL, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, filename, line, "", "%s", text.substr(sub_index, std::string::npos).c_str()); } } break; case console_bridge::CONSOLE_BRIDGE_LOG_ERROR: { ROSCONSOLE_DEFINE_LOCATION(true, ::ros::console::levels::Error, prefix); if (ROS_UNLIKELY(__rosconsole_define_location__enabled)) { ::ros::console::print(NULL, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, filename, line, "", "%s", text.substr(sub_index, std::string::npos).c_str()); } } break; default: // debug { ROSCONSOLE_DEFINE_LOCATION(true, ::ros::console::levels::Debug, prefix); if (ROS_UNLIKELY(__rosconsole_define_location__enabled)) { ::ros::console::print(NULL, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, filename, line, "", "%s", text.substr(sub_index, std::string::npos).c_str()); } } break; } } RegisterOutputHandlerProxy::RegisterOutputHandlerProxy(void) { static OutputHandlerROS oh_ros; console_bridge::useOutputHandler(&oh_ros); // we want the output level to be decided by rosconsole, so we bring all messages to rosconsole console_bridge::setLogLevel(console_bridge::CONSOLE_BRIDGE_LOG_DEBUG); } }