[rosconsole-bridge] 01/02: Imported Upstream version 0.4.2
Jochen Sprickerhof
jspricke-guest at moszumanska.debian.org
Mon Jun 1 12:35:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
jspricke-guest pushed a commit to branch master
in repository rosconsole-bridge.
commit f0a653d13d7a862fdf47959e63e92a6e6b1c20f0
Author: Jochen Sprickerhof <git at jochen.sprickerhof.de>
Date: Mon Jun 1 12:11:39 2015 +0200
Imported Upstream version 0.4.2
---
CHANGELOG.rst | 98 ++++++++++++++++++++++++++++
CMakeLists.txt | 31 +++++++++
README.md | 4 ++
include/rosconsole_bridge/bridge.h | 62 ++++++++++++++++++
package.xml | 23 +++++++
src/bridge.cpp | 129 +++++++++++++++++++++++++++++++++++++
6 files changed, 347 insertions(+)
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
new file mode 100644
index 0000000..f1e7219
--- /dev/null
+++ b/CHANGELOG.rst
@@ -0,0 +1,98 @@
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+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 <https://github.com/ros/rosconsole_bridge/issues/8>`_)
+
+0.4.0 (2014-06-24)
+------------------
+* rename variables within rosconsole macros (`ros/ros_comm#442 <https://github.com/ros/ros_comm/issues/442>`_)
+* convert to use console bridge from upstream debian package (`ros/rosdistro#4633 <https://github.com/ros/rosdistro/issues/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
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..7572c65
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_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"
+)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c4c58a5
--- /dev/null
+++ b/README.md
@@ -0,0 +1,4 @@
+rosconsole_bridge
+=================
+
+Pipes console_bridge output to rosconsole/rosout when console_bridge is used in a ROS-dependent package
diff --git a/include/rosconsole_bridge/bridge.h b/include/rosconsole_bridge/bridge.h
new file mode 100644
index 0000000..c942044
--- /dev/null
+++ b/include/rosconsole_bridge/bridge.h
@@ -0,0 +1,62 @@
+/*********************************************************************
+* 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 <console_bridge/console.h>
+
+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
diff --git a/package.xml b/package.xml
new file mode 100644
index 0000000..8233dde
--- /dev/null
+++ b/package.xml
@@ -0,0 +1,23 @@
+<package>
+ <name>rosconsole_bridge</name>
+ <version>0.4.2</version>
+ <description>rosconsole_bridge is a package used in conjunction with console_bridge and rosconsole for connecting console_bridge-based logging to rosconsole-based logging.</description>
+
+ <author>Ioan Sucan</author>
+
+ <maintainer email="dthomas at osrfoundation.org">Dirk Thomas</maintainer>
+ <maintainer email="isucan at gmail.com">Ioan Sucan</maintainer>
+ <license>BSD</license>
+
+ <url type="website">http://www.ros.org/wiki/rosconsole_bridge</url>
+ <url type="bugtracker">https://github.com/ros/rosconsole_bridge/issues</url>
+ <url type="repository">https://github.com/ros/rosconsole_bridge</url>
+
+ <buildtool_depend>catkin</buildtool_depend>
+ <build_depend>libconsole-bridge-dev</build_depend>
+ <build_depend version_gte="1.11.5">rosconsole</build_depend>
+
+ <run_depend>libconsole-bridge-dev</run_depend>
+ <run_depend>rosconsole</run_depend>
+
+</package>
diff --git a/src/bridge.cpp b/src/bridge.cpp
new file mode 100644
index 0000000..e6e886e
--- /dev/null
+++ b/src/bridge.cpp
@@ -0,0 +1,129 @@
+/*********************************************************************
+* 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 <ros/console.h>
+#include <console_bridge/console.h>
+#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);
+}
+
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ros/rosconsole-bridge.git
More information about the debian-science-commits
mailing list