![]() |
slope 6.2.1
|
Thread-safe warning logger for tracking runtime warnings. More...
#include <logger.h>
Static Public Member Functions | |
| static void | addWarning (WarningCode code, const std::string &message) |
| Log a new warning. | |
| static std::vector< Warning > | getWarnings () |
| Retrieve all warnings from all threads. | |
| static void | clearWarnings () |
| Clear all warnings. | |
| static bool | hasWarnings () |
| Check if any warnings have been logged. | |
| static std::vector< Warning > | getThreadWarnings (int thread_id) |
| Get warnings from a specific thread. | |
Thread-safe warning logger for tracking runtime warnings.
WarningLogger provides facilities for logging, retrieving, and managing warnings that occur during computation. It is thread-safe and designed to work with OpenMP parallel regions.
Warnings are tracked per thread and can be accessed either individually by thread or aggregated across all threads.
|
static |
Log a new warning.
Stores a warning message associated with a specific warning code. Thread-safe and can be called from within OpenMP parallel regions. If a warning with the same code already exists for the current thread, the message will be replaced.
| code | The warning code categorizing this warning |
| message | Descriptive message for the warning |
|
static |
Clear all warnings.
Removes all warnings across all threads.
|
static |
Get warnings from a specific thread.
Retrieves all warnings that were logged by a particular thread.
| thread_id | The ID of the thread whose warnings should be retrieved |
|
static |
Retrieve all warnings from all threads.
Combines warnings from all threads into a single collection.
|
static |
Check if any warnings have been logged.