Formatter

struct Formatter

Undocumented

  • Undocumented

    Declaration

    Swift

    public typealias DataFormatterType = (Data) -> (String)
  • Undocumented

    Declaration

    Swift

    public typealias EntryFormatterType = (_ identifier: String, _ message: String, _ target: TargetType) -> String
  • Undocumented

    Declaration

    Swift

    public var entry: EntryFormatterType
  • Undocumented

    Declaration

    Swift

    public var requestData: DataFormatterType
  • Undocumented

    Declaration

    Swift

    public var responseData: DataFormatterType
  • The designated way to instanciate a Formatter.

    Declaration

    Swift

    public init(entry: @escaping EntryFormatterType = defaultEntryFormatter,
                requestData: @escaping DataFormatterType = defaultDataFormatter,
                responseData: @escaping DataFormatterType = defaultDataFormatter)

    Parameters

    entry

    The closure formatting a message into a new log entry.

    requestData

    The closure converting HTTP request’s body into a String. The default value assumes the body’s data is an utf8 String.

    responseData

    The closure converting HTTP response’s body into a String. The default value assumes the body’s data is an utf8 String.