mrdocs::report::Reporter
The reporter of one run.
Synopsis
Declared in <mrdocs/Support/Reporter.hpp>
class Reporter;
Description
A reporter formats, prints and counts the messages of a run. It owns the minimum level, whether an error shows where in the source it came from, the warn‐as‐error setting and the counters, so two reporters never see each other's settings or totals. A Session owns the reporter of its run and returns it from Session::log. The core and the finalizers receive it from the session, and a plugin through the report field of its context.
warn‐as‐error applies to every warning. When it is set, warn reports at Level::error, so a warning of the core, of a script (ctx.report.warn) and of a plugin (ctx.report‐>warn) all fail the run, and the run counts them as errors. The message is still printed where it is reported, with the others.
Every function is safe to call from several threads at once. The reporters of a process share one lock for the console, so the lines of two runs never mix.
session.log().warn("{} has no brief", symbol.Name);
if (session.log().results().errorCount > 0)
{
return EXIT_FAILURE;
}
Member Functions
Name |
Description |
|
Constructor. |
|
Destructor. |
|
Copy assignment operator |
Emit a debug‐level diagnostic for troubleshooting. |
|
Emit an error that indicates failure but allows continuation. |
|
Emit a fatal error and mark the report as the highest severity. |
|
Get the minimum threshold level for reporting. |
|
Emit an informational message for users. |
|
Format a message to the console. |
|
|
|
Return the number of messages reported so far, by level. |
|
Set the minimum threshold level for reporting. |
|
Set whether errors carry the location they were reported from. |
|
Set whether the run treats warnings as errors. |
|
Emit a trace‐level diagnostic (verbose, off by default). |
|
Emit a warning. |
|
Return whether the run treats warnings as errors. |
Created with MrDocs