ObservabilityScope
Observability.swift:67final class ObservabilityScope
final class ObservabilityScope
import Basics
protocol CustomStringConvertible
A type with a customized textual representation.
protocol DiagnosticsEmitterProtocol
protocol Sendable
let description: String
var errorsReported: Bool { get }
var errorsReportedInAnyScope: Bool { get }
func emit(_ diagnostic: Diagnostic)
func makeChildScope(description: String, metadata: ObservabilityMetadata? = .none) -> Self
func makeChildScope(description: String, metadataProvider: () -> ObservabilityMetadata) -> Self
func makeDiagnosticsEmitter(metadata: ObservabilityMetadata? = .none) -> DiagnosticsEmitter
func makeDiagnosticsEmitter(metadataProvider: () -> ObservabilityMetadata) -> DiagnosticsEmitter
func makeDiagnosticsHandler() -> (TSCBasic.Diagnostic) -> Void
func emit(_ error: Error, metadata: ObservabilityMetadata? = .none)
func emit(debug message: String, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(error message: String, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(info message: String, 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)
@discardableResult func trap(_ closure: () throws -> Void) -> Bool
trap a throwing closure, emitting diagnostics on error and returning boolean representing success