-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rosmon_core: Adding verbosity filter feature #119
Conversation
Interesting, thanks for the PR! Finding the log severity by color seems a bit hacky to me. I would like to propose a simpler solution: we already capture stdout/stderr separately to support Maybe adding a key to hide [Personal opinion on node output: if a launch file output gets too verbose to read, I try to fix the involved nodes instead of filtering the output. |
Maybe? I separated ROS_DEBUG and ROS_INFO partially because we typically run our nodes with ROS_INFO as the minimum visible level, and also because for Regardless having a Another thing that we might be able to do now that I think about it, is to just use the underlying |
At least in the default configuration, ROS_DEBUG messages are not printed by the nodes. You either need a rosconsole configuration file or set it interactively using
Yep, let's focus on that first.
I thought about this as well. Well, we know the node name for all nodes, that's no problem. But logger names is a larger problem. Do we add a fancy selection UI? I think that would be too much for rosmon. So all we could do is something like "set all loggers in a particular node to level X". I think that's not very useful, since most of the time I want the default logger set to debug, but all the roscpp internals to INFO... |
4f590ba
to
b927232
Compare
So I took a look at the code and I couldn't really find where stdout/stderr were differentiated. I looked inside Am I missing something? I still don't see how else to differentiate WARN/ERROR from other types of messages without reading the ANSI color code. As far as I can tell you set up your own file descriptor in the |
Oops, I thought that feature was in master already... But it seems I started working on it but never merged it. Sorry for misleading you ;) I found the old branch: |
Ah, that branch makes much more sense now. I rebased the branch on top of master (no conflicts so all good). Should I merge that branch into |
I just did the rebase as well ;) I noticed that it has failing unit tests - presumably because it tests Yep, if you like merge that into your branch and we will treat it as one PR. |
d24d6b8
to
3685b79
Compare
Ok i pulled in the stderr branch into this branch and added new filter logic on top for verbosity filter. Now it's just F8 to toggle WARN+ output, and the logic is such that if Doublecheck the unittests for stdout_stderr. I tried to fill in what I think you were intending for the checks. It passes, I just didn't know how |
Everything looks good, thanks for your work! Yep, the unit tests should just test |
Here's yet another filter I added to
rosmon
. This was a bit tricky to get proper, but the tl;dr is that this uses thefgColor
value to determine the log level. The reason why I went this route was a couple of reasons:fgColor
and it's simple to implement.I added F6, F7, and F8 as keys to select the verbosity level. Currently I just have it set to display levels 1, 2, and 3, but if you want I can change it to show 'Low, Med, High' or some effect.
WARN
+ messages printedINFO
+ messages printedDEBUG
+ messages printed (all)Also as a consequence of this, this inevitably adds to the already increasing size of the control bar. Something I thought of was to make the bar 'togglable', like with F1 or some key. This way we could have the default bar be just status messages (like Mute and Verbosity level) and if the user wants to see the controls, they can press
F1
and a multi-level bar could appear with all options outlined.If we want to do that that'll have to be a separate PR (I haven't written code for that, just my musings).