Open sandboxFocus

Class DiagnosticReporter

A utility class that makes it easy to report diagnostics from code queries in different environments. The default implementation writes messages to the console using the ReportToConsole(IReadOnlyList<IIntrospectionDiagnostic>) method. The action can be changed by setting the ReportAction property.

Inheritance
DiagnosticReporter
Namespace: Metalama.Framework.Workspaces
Assembly: Metalama.Framework.Workspaces.dll
Syntax
public static class DiagnosticReporter

Properties

Name Description
ReportAction

Gets or sets the action to execute when diagnostics are reported. The default action is ReportToConsole(IReadOnlyList<IIntrospectionDiagnostic>).

ReportedErrors

Gets the number of errors reported since the last call to ClearCounters().

ReportedWarnings

Gets the number of warnings reported since the last call to ClearCounters().

Methods

Name Description
ClearCounters()

Clears the ReportedWarnings and ReportedErrors counters.

Report(IEnumerable<IDeclaration>, Severity, string, string)
Report(IEnumerable<IIntrospectionDiagnostic>)
Report(IEnumerable<IIntrospectionReference>, Severity, string, string)
ReportToConsole(IReadOnlyList<IIntrospectionDiagnostic>)

See Also