Warning message aggregator for reducing console flooding. More...
#include <global.h>
Public Member Functions | |
| WarningAggregator ()=default | |
| Constructor. | |
| void | addWarning (const std::string &category, const std::string &message) |
| Add a warning to be aggregated. | |
| void | report (std::ostream &stream=std::cerr, bool compact=false) |
| Report all accumulated warnings and clear. | |
| size_t | getCount (const std::string &category) const |
| Get the count of warnings for a specific category. | |
| void | clear () |
| Clear all accumulated warnings. | |
| void | setEnabled (bool enabled) |
| Enable or disable warning accumulation. | |
| bool | isEnabled () const |
| Check if warning accumulation is enabled. | |
Warning message aggregator for reducing console flooding.
Accumulates warning messages during loops/iterations and reports aggregated summaries.
This class helps prevent console flooding when processing millions of primitives/objects by collecting warnings and reporting counts with example messages instead of printing each warning individually. Thread-safe for use in OpenMP parallel regions.
Example usage:
| void helios::WarningAggregator::addWarning | ( | const std::string & | category, |
| const std::string & | message | ||
| ) |
Add a warning to be aggregated.
| [in] | category | Category identifier for this warning type (e.g., "fzero_convergence_failure") |
| [in] | message | The warning message text |
Definition at line 3026 of file global.cpp.
| void helios::WarningAggregator::clear | ( | ) |
Clear all accumulated warnings.
Definition at line 3094 of file global.cpp.
| size_t helios::WarningAggregator::getCount | ( | const std::string & | category | ) | const |
Get the count of warnings for a specific category.
| [in] | category | Category identifier |
Definition at line 3084 of file global.cpp.
| bool helios::WarningAggregator::isEnabled | ( | ) | const |
Check if warning accumulation is enabled.
Definition at line 3104 of file global.cpp.
| void helios::WarningAggregator::report | ( | std::ostream & | stream = std::cerr, |
| bool | compact = false |
||
| ) |
Report all accumulated warnings and clear.
| [in] | stream | Output stream to write warnings to (default: std::cerr) |
| [in] | compact | If true, output single line per category with count only (default: false) |
Definition at line 3043 of file global.cpp.
| void helios::WarningAggregator::setEnabled | ( | bool | enabled | ) |
Enable or disable warning accumulation.
| [in] | enabled | True to enable, false to disable |
Definition at line 3100 of file global.cpp.