ConcatenatingLogFormatter

open class ConcatenatingLogFormatter: LogFormatter

The ConcatenatingLogFormatter lets you combine the output of multiple LogFormatters by contatenating their output and returning the result.

  • The LogFormatters whose output will be concatenated.

    Declaration

    Swift

    open let formatters: [LogFormatter]
  • Initializes a new ConcatenatingLogFormatter instance.

    Declaration

    Swift

    public init(formatters: [LogFormatter])

    Parameters

    formatters

    The LogFormatters whose output will be concatenated.

  • Formats the LogEntry by passing it to each of the receiver’s LogFormatters and concatenating the output.

    Declaration

    Swift

    open func format(_ entry: LogEntry)
            -> String?

    Parameters

    entry

    The LogEntry to be formatted.

    Return Value

    The formatted result, or nil if none of the receiver’s formatters returned a non-nil value when formatting entry.