LiteralLogFormatter

public struct LiteralLogFormatter: LogFormatter

A LogFormatter that returns always returns a given literal string regardless of input.

This is typically combined with other LogFormatters within a ConcatenatingLogFormatter.

  • The literal string used as the return value of the receiver’s format(_:) function.

    Declaration

    Swift

    public let literal: String
  • Initializes a new LiteralLogFormatter to contain the given string.

    Declaration

    Swift

    public init(_ string: String)

    Parameters

    string

    The literal string.

  • Returns the value of the receiver’s literal property.

    Declaration

    Swift

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

    Parameters

    entry

    Ignored by this implementation.

    Return Value

    The value of the receiver’s literal property; never nil.