From 134539fa616c8653acca5bd519286457f8c66eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Kali=C5=84ski?= <47140412+KaQuMiQ@users.noreply.github.com> Date: Fri, 28 Jul 2023 17:05:42 +0200 Subject: [PATCH] Add custom error logging --- Sources/MQ/Errors/TheError.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/MQ/Errors/TheError.swift b/Sources/MQ/Errors/TheError.swift index f86c217..22e9ccc 100644 --- a/Sources/MQ/Errors/TheError.swift +++ b/Sources/MQ/Errors/TheError.swift @@ -46,6 +46,15 @@ public protocol TheError: Error, CustomStringConvertible, CustomDebugStringConve func isEqual( to other: Error ) -> Bool + /// Log this error. + /// + /// Logging is provided by this method implemetation. + /// Default uses ``Diagnostics.shared`` instance with description + /// or debugDescription in message content. + /// + /// - Returns: The same error instance. + @discardableResult + @Sendable func log() -> Self } // swift-format-ignore: AllPublicDeclarationsHaveDocumentation