PayloadLogFormatter
public struct PayloadLogFormatter: LogFormatter
A LogFormatter that returns a string representation of a LogEntry‘s
payload property.
-
The
LogFormatterused by the receiver when encountering aLogEntrywhosepayloadproperty contains a.tracevalue.Declaration
Swift
public let traceFormatter: LogFormatter -
The
LogFormatterused by the receiver when encountering aLogEntrywhosepayloadproperty contains a.messagevalue.Declaration
Swift
public let messageFormatter: LogFormatter -
The
LogFormatterused by the receiver when encountering aLogEntrywhosepayloadproperty contains a.valuevalue.Declaration
Swift
public let valueFormatter: LogFormatter -
The initializer.
Declaration
Swift
public init(traceFormatter: LogFormatter = PayloadTraceLogFormatter(), messageFormatter: LogFormatter = PayloadMessageLogFormatter(), valueFormatter: LogFormatter = PayloadValueLogFormatter()) -
Formats the passed-in
LogEntryby returning a string representation of itspayloadproperty.Declaration
Swift
public func format(_ entry: LogEntry) -> String?Parameters
entryThe
LogEntryto be formatted.Return Value
The formatted result, or
nilif formatting was not possible for the given message.
View on GitHub
PayloadLogFormatter Struct Reference