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

Supress log statistics INFO log --> DEBUG #93

Conversation

reinzor
Copy link

@reinzor reinzor commented Sep 27, 2024

No description provided.

@novatel-applications-engineering
Copy link
Contributor

Hi @reinzor

Thank you for the pull request.

We are discussing this change internally.

Could you please clarify the reason behind this change? Are you running into issues with this being output too frequently?

@reinzor
Copy link
Author

reinzor commented Oct 1, 2024

Could you please clarify the reason behind this change? Are you running into issues with this being output too frequently?

Yes, we are working on cleaning up the output logs of our system. These messages are being logged frequently and pollute the output log.

@Timple
Copy link

Timple commented Oct 1, 2024

This kind of debug information would typically be well suited on a /diagnostics topic: #3

Should work better than repetitive prints

@novatel-applications-engineering
Copy link
Contributor

Thanks for the clarification. We are looking further into this. I will let you know when I have an update.

@novatel-applications-engineering
Copy link
Contributor

Hi @reinzor,

We discussed internally and appreciate you suggestion to reduce console output. We have decided on a solution that condenses the console output from outputLogStatistics from 20 lines using a default driver configuration to 1 line each time it is called. We did not want to fully move it off of the INFO stream as it is useful for users to rapidly verify receiver connection and if specific logs are being collected from the receiver.

I'm not able to commit to this pull request due to it coming from your library. Our changes to the function outputLogStatistics that we will push are:

    void outputLogStatistics()
    {
      std::string output_statistics = "Receiver Log Statistics: " + std::to_string(total_log_count_) + "; unknown: "   + std::to_string(unknown_msg_num_)
                                                       + "; discarded: " + std::to_string(discarded_msg_num_);

      for(log_count_map_t::iterator itr = log_counts_.begin();
                                    itr != log_counts_.end();
                                    itr++)
      {
        int  id    = itr->first;
        long count = itr->second;
        output_statistics += "; Log[" + std::to_string(id) + "]:" + std::to_string(count);
      }
      
      RCLCPP_INFO_STREAM(get_logger(), output_statistics);
    }

Does this resolve your issue of having a polluted output log?

@reinzor
Copy link
Author

reinzor commented Oct 10, 2024

Thanks for coming back @novatel-applications-engineering ; this would already help but is unfortunately not sufficient for us. I agree with @Timple that incorporating this into diagnostics would be the proper solution. This would enable the user to look up these statistics when desired. It is always a matter of taste but in my opinion periodic logs from drivers (in nominal mode) should never end up in a level higher than DEBUG.

@novatel-applications-engineering
Copy link
Contributor

Thanks @reinzor for the feedback.

We will go ahead and apply your initially requested change. I am also updating another periodic log that gets reported of the IMU scale factors to change that from INFO to DEBUG. That should clear all of the regularly published logs in nominal mode.

I am raising this request internally to also update our features request list to have a diagnostics topic also include the log statistics.

@novatel-applications-engineering novatel-applications-engineering merged commit 19dccbc into novatel:jazzy-dev Oct 11, 2024
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.

3 participants