osrf / capabilities

Implements the concept of capabilities as part of the robots-in-concert system.
Other
8 stars 26 forks source link

Add node name to log output #24

Open bit-pirate opened 10 years ago

bit-pirate commented 10 years ago

Then one can easily identify where a log message is coming from (without the need of rqt_console).

Here for example the app manager:

[INFO] [WallTime: 1381746358.003231] App Manager : loading app 'turtlebot_core_apps/auto_docking'
[INFO] [WallTime: 1381746358.360199] Servicing request for capability specs...

Second message is from the capability server.

Instead of prepending a (fixed) name, we could also append the real node name, e.g. capability_server.

wjwwood commented 10 years ago

I would not add the node name to the log message directly, ros logging handles that for you, I would instead change the output format:

http://wiki.ros.org/rosconsole#Console_Output_Formatting

To something like this:

export ROSCONSOLE_FORMAT='[${severity}] [${time}]: ${node}: ${message}'

What do you think?

bit-pirate commented 10 years ago

Hm, I must have close a tab before sending my reply...


Your suggestion sound great! Didn't know about this rosconsole feature.

However, I tried it and somehow it doesn't seem to work with rospy nodes. E.g. I'm launching turtlebot's minimal with app manager launcher plus capability server. The only thing adhering to my rosconsole format is the C++ node zeroconf. Maybe there is a related bug in rospy?

wjwwood commented 10 years ago

Looks like rospy does not respect this >.<

wjwwood commented 10 years ago

Maybe we should just fix it in rospy... Let me look into to how bad that would be.

mbeards commented 10 years ago

@wjwwood , any insights into this issue?

wjwwood commented 10 years ago

The fix in rospy hasn't been made yet, and I'm not sure if we can do it in hydro and groovy, so I plan to fix this problem in capabilities for now, probably once we get the Indigo farm up and running I will spend some time on this.