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

Add bool return to _base_logger, log* functions #2335

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

owenclaxton-QUT
Copy link

Add a bool return to expose whether log succeeded for:

  • _base_logger
  • log* functions (log*, log*_throttle, log*_once, etc...)

Explanation
Provides the user a trigger for actions which may be sensitive to logging (i.e. creating a 'static' diagnostic display). The return will be true, if:

  • is_initialized() succeeded
  • it was 'time' for a throttled logger to write a new log event
    In both these cases, true represents a change to console, false represents no change.

Specific example use case:
When working with the log*_throttle functions, I needed a way to detect whether a loginfo_throttle was actually printing, as I needed to know how many lines to escape and clear before writing new content on-top for a 'static' diagnostic display. The bool already existed, but just needed to be exposed to the user.

Add a bool return to expose whether log succeeded for:
- _base_logger
- log* functions (log*, log*_throttle, log*_once, etc...)
Provides the user a trigger for actions which may be sensitive to logging (i.e. creating a 'static' positioned diagnostic display)
Copy link
Contributor

@peci1 peci1 left a comment

Choose a reason for hiding this comment

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

This change looks okay to me, but it needs a second eye.

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

Successfully merging this pull request may close these issues.

2 participants