Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

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

Merged
dirk-thomas merged 1 commit into
ros:melodic-develfrom
yli-cpr:melodic-devel
May 18, 2018
Merged

dirk-thomas merged 1 commit into
ros:melodic-develfrom
yli-cpr:melodic-devel

Conversation

@yli-cpr

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

Copy link
Copy Markdown
Contributor

See issue #1380.

@yli-cpr

yli-cpr commented May 1, 2018

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

yli-cpr commented May 1, 2018 •

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

yli-cpr commented May 2, 2018

Copy link
Copy Markdown
Contributor Author

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

yli-cpr commented May 2, 2018

Copy link
Copy Markdown
Contributor Author

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

@yli-cpr

yli-cpr commented May 2, 2018

Copy link
Copy Markdown
Contributor Author

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

yli-cpr commented May 3, 2018

Copy link
Copy Markdown
Contributor Author

Ping reviewers

Comment thread tools/rosout/rosout.cpp
if (!handle_)
{
return;
}

Copy link
Copy Markdown
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
Copy Markdown
Member

Looks good to me. 👍

@yli-cpr

yli-cpr commented May 3, 2018

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Member

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

@yli-cpr

yli-cpr commented May 9, 2018

Copy link
Copy Markdown
Contributor Author

ping @dirk-thomas

@dirk-thomas

Copy link
Copy Markdown
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

yli-cpr commented May 22, 2018

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Member

@yli-cpr

yli-cpr commented May 29, 2018 via email

Copy link
Copy Markdown
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants