PayloadLogFormatter
public struct PayloadLogFormatter: LogFormatter
A LogFormatter
that returns a string representation of a LogEntry
‘s
payload
property.
-
The
LogFormatter
used by the receiver when encountering aLogEntry
whosepayload
property contains a.trace
value.Declaration
Swift
public let traceFormatter: LogFormatter
-
The
LogFormatter
used by the receiver when encountering aLogEntry
whosepayload
property contains a.message
value.Declaration
Swift
public let messageFormatter: LogFormatter
-
The
LogFormatter
used by the receiver when encountering aLogEntry
whosepayload
property contains a.value
value.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
LogEntry
by returning a string representation of itspayload
property.Declaration
Swift
public func format(_ entry: LogEntry) -> String?
Parameters
entry
The
LogEntry
to be formatted.Return Value
The formatted result, or
nil
if formatting was not possible for the given message.