Instance Methodswift-package-manager 6.0.3Basics
emit(debug:metadata:underlyingError:)
Observability.swift:228func emit(debug message: CustomStringConvertible, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
func emit(debug message: CustomStringConvertible, metadata: ObservabilityMetadata? = .none, underlyingError: Error? = .none)
s6Basics26DiagnosticsEmitterProtocolPAAE4emit5debug8metadata15underlyingErrorys23CustomStringConvertible_p_AA21ObservabilityMetadataVSgs0I0_pSgtF
What are these?I6X6
import Basics
protocol DiagnosticsEmitterProtocol
protocol CustomStringConvertible
A type with a customized textual representation.
struct ObservabilityMetadata
Provides type-safe access to the ObservabilityMetadata’s values. This API should ONLY be used inside of accessor implementations.
protocol Error : Sendable
A type representing an error value that can be thrown.
func emit(_ diagnostics: [Diagnostic])
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(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