DiagnosticsEmitterProtocol
Observability.swift:161protocol DiagnosticsEmitterProtocol
Browse conforming typesprotocol DiagnosticsEmitterProtocol
import Basics
func emit(_ diagnostic: Diagnostic)
func emit(_ diagnostics: [Diagnostic])
func emit(_ error: Error, metadata: ObservabilityMetadata? = .none)
func emit(debug message: String, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(debug message: CustomStringConvertible, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(error message: String, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(error message: CustomStringConvertible, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(info message: String, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(info message: CustomStringConvertible, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(severity: Diagnostic.Severity, message: String, metadata: ObservabilityMetadata? = .none)
func emit(warning message: String, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(warning message: CustomStringConvertible, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
@discardableResult func trap(_ closure: () throws -> Void) -> Bool
trap a throwing closure, emitting diagnostics on error and returning boolean representing success
func trap<T>(_ closure: () throws -> T) -> T?
trap a throwing closure, emitting diagnostics on error and returning the value returned by the closure