Skip to content
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

Allow disabling rosout file logging (to rosout.log) #1381

Merged
merged 1 commit into from
May 18, 2018

Conversation

yli-cpr
Copy link
Contributor

@yli-cpr yli-cpr commented May 1, 2018

See issue #1380.

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 1, 2018

I still see rosout.log with only something like

1525185689.259271782  Node Startup

It is probably because the ROS parameter server isn't immediately ready when rosout is being used.

@dirk-thomas
Copy link
Member

As you have noticed you can't rely on the parameter server to be available that "early" in the process. So this will need a different approach to configure.

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 1, 2018

@dirk-thomas I chose this approach because there is another ros parameter it is using, /rosout/omit_topics. Any suggestion about alternative approaches? Will using an environment variable be acceptable?

@dirk-thomas
Copy link
Member

Will using an environment variable be acceptable?

That would be fine. It needs to be documented well though in order to be discoverable.

@mikepurvis
Copy link
Member

How critical is it to not log at all from startup? IMO using a parameter is reasonable and still suppresses the log-to-file behaviour after only a short period.

@dirk-thomas
Copy link
Member

I expected the use case to be "don't want to log because don't have a writable fs". We had similar comments before (don't find the reference right now though).

@mikepurvis
Copy link
Member

Okay, fair— I know there's been chatter on ROS Answers in the past about redirecting all the output to /dev/null or whatever, but yeah, if it must be nothing at all then an envvar would be more appropriate.

At least in our case, the scenario is that we already have rosout recorded in bags; recording it a second time is just more files to rotate and manage.

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 2, 2018

The rosout node is launched by roslaunch internally and the <env>s defined in launch file are not forwarded to rosout. So with this solution, one must provide this environment variable to roslaunch. In my test, I set it in /etc/ros/setup.bash.

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 2, 2018

Wait. I found the reason why I got that first log. That's from rosout itself. Let me redo it.

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 2, 2018

Actually the ROS parameter is ready when Rosout is constructed. So I am using ros parameter again now, but at earlier stage. In this way, it won't create rosout.log file at all.

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 3, 2018

Ping reviewers

if (!handle_)
{
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice if this could handled as a RAII thing when it goes out of scope, but appreciating that you're just trying to patch in a small fix and not rewrite the whole thing, LGTM.

@mikepurvis
Copy link
Member

Looks good to me. 👍

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 3, 2018

@mikepurvis Thanks. I don't have the write access. Can you merger it for me? Also I need to cherry-pick it to lunar-edge. Should that be another pull request?

@mikepurvis
Copy link
Member

Let's wait on a verdict from @dirk-thomas as well.

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 9, 2018

ping @dirk-thomas

@dirk-thomas
Copy link
Member

Let's wait on a verdict from @dirk-thomas as well.

LGTM

I need to cherry-pick it to lunar-edge. Should that be another pull request?

Before a new release is being made into older ROS distros all patches in the newer ROS distro are being considered. A PR is being made which contains all backported patches but mentions all considered patches. Feature requests have in general a smaller chance of being backported though.

@yli-cpr Please also add documentation about the new parameter to the wiki with a note that it will be available as of Melodic (for now). Please also post a link to the diff here for future readers to find the documentation.

@dirk-thomas dirk-thomas merged commit dac6635 into ros:melodic-devel May 18, 2018
@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 22, 2018

Wiki page updated: http://wiki.ros.org/rosout. But I don't know how to make it melodic specific.

yli-cpr added a commit to yli-cpr/ros_comm that referenced this pull request May 28, 2018
@dirk-thomas
Copy link
Member

@yli-cpr Please see http://wiki.ros.org/action/info/rosout?action=diff&rev2=52&rev1=51 how to use the Version macro for this.

@yli-cpr
Copy link
Contributor Author

yli-cpr commented May 29, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants