From 13a81f9b16122df949a90ad8031ce9e6bd1fdffa Mon Sep 17 00:00:00 2001 From: Daniele Margutti Date: Tue, 11 Jul 2023 15:15:32 +0200 Subject: [PATCH] feat: added default XCodeFormatter to OSLogTransport configuration --- Glider/Sources/Transports/Console/OSLogTransport.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Glider/Sources/Transports/Console/OSLogTransport.swift b/Glider/Sources/Transports/Console/OSLogTransport.swift index 33fdba6..502fc28 100644 --- a/Glider/Sources/Transports/Console/OSLogTransport.swift +++ b/Glider/Sources/Transports/Console/OSLogTransport.swift @@ -126,7 +126,14 @@ extension OSLogTransport { // MARK: - Initialization - public init(_ builder: ((inout Configuration) -> Void)?) { + /// Initialize a new configuration for `OSLogTransport`. + /// + /// - Parameters: + /// - formatters: formatters to use. Ignore to use the default `XCodeFormatter`. + /// - builder: builder configuration function. + public init(formatters: [EventMessageFormatter] = [XCodeFormatter.init()], + _ builder: ((inout Configuration) -> Void)?) { + self.formatters = formatters self.queue = DispatchQueue(label: String(describing: type(of: self)), attributes: []) builder?(&self) }