public func withLogger<Result, Failure: Error>(
_ logger: Logger,
_ operation: (Logger) throws(Failure) -> Result
) throws(Failure) -> Result {
do {
return try Logger.withTaskLocalLogger(logger) {
try operation(logger)
}
} catch {
throw error as! Failure
}
}
Swift issue swiftlang/swift#75520
The code in question: