SwiftDocCDiagnosticEngineClassDiagnosticEngineA type that collects and dispatches diagnostics during compilation.final class DiagnosticEngineTopicsInitializersinit(filterLevel: DiagnosticSeverity, treatWarningsAsErrors: Bool)Creates a new diagnostic engine instance with no consumers.Instance Propertiesvar filterLevel: DiagnosticSeverityDetermines which problems will be emitted to consumers.var problems: [Problem]A convenience accessor for retrieving all of the diagnostics this engine currently holds.Instance Methodsfunc add(any DiagnosticConsumer)Subscribes a given consumer to the diagnostics emitted by this engine.func clearDiagnostics()Removes all of the encountered diagnostics from this engine.func emit(Problem)Dispatches a diagnostic to all subscribed consumers.func emit([Problem])Dispatches multiple diagnostics to consumers.func flush()func hasConsumer(matching: (any DiagnosticConsumer) throws -> Bool) rethrows -> BoolReturns a Boolean value indicating whether the engine contains a consumer that satisfies the given predicate.func remove(any DiagnosticConsumer)Unsubscribes a given consumer