diagnostics icon indicating copy to clipboard operation
diagnostics copied to clipboard

Updater::add to take ownership of FunctionDiagnosticTask

Open russkel opened this issue 2 years ago • 2 comments

I believe this should probably be supported:

  diagnostic_updater::FunctionDiagnosticTask helm_diag(
          "Helm", [&helm_report](diagnostic_updater::DiagnosticStatusWrapper & stat) {
              stat.add("Modes", helm_report.getModeSummary());
              stat.add("Halted", helm_report.getHalted());
          });

  diag_updater->add(std::move(helm_diag));

Unfortunately, this doesn't work and segfaults when helm_diag goes out of scope.

russkel avatar Jul 31 '23 03:07 russkel

Thanks for your issue, @russkel. Could you please describe what you are trying to achieve in more detail? What is ivp_diag? Please feel free to provide a test that and / or implementation in a pull request.

ct2034 avatar Sep 26 '23 12:09 ct2034

What is ivp_diag?

A mistake in my copy and paste, apologies. It should be helm_diag.

Please feel free to provide a test that and / or implementation in a pull request.

Okay. We (my colleague and I) were a bit surprised by the interface to the diagnostic_updater and felt it could probably be easier. We hope to improve this or at the very least have specific feature requests.

russkel avatar Sep 27 '23 08:09 russkel