ros/rosconsole_bridge — pull request #4 by davetcoleman (2014-02-12 03:30:34+00:00)
Title: Allows non-ROS components to utilize the prefix functionality of log4j

One of my favorite aspects of rosconsole is the ability to filter out various debug messages based on their package and subgroup. The shift to making more ROS-agnostic components is great but their use of rosconsole_bridge removes this functionality. If you want to see the debug output of just one non-ROS component, you have to turn on the debug output of all non-ROS components. This is terminal output overload.

In this pull request, which should be targeted for an ``indigo-devel`` branch (though I can't do that on Github directly), I propose the ability for components, such as moveit_core in my case, to be able to specify their prefix using the format

```
"[no spaces prefix]: message"
```

For example...

```
logDebug("ros_core.kinematics: 7 joints detected")
```

Would be parsed by rosconsole bridge to be the equivalent of

```
ROS_DEBUG_NAMED("ros_core.kinematics","7 joints detected")
```

And assuming you've configured your rosconsole to be something like

```
export ROSCONSOLE_FORMAT='${severity} ${logger}: ${message}'
```

You should see the output:

```
DEBUG ros.rosconsole_bridge.ros_core.kinematics: 7 joints detected
```

Note that this PR is a little bit of a first-pass because I wanted to gauge if this feature would be accepted if finished. Currently I have not actually implemented the regex because I'm not good at regex and it would take me some trial and error, and because my solution below is working for me for now.