AWSDDLogFileFormatterDefault

Objective-C

@interface AWSDDLogFileFormatterDefault : NSObject <AWSDDLogFormatter>

Swift

class AWSDDLogFileFormatterDefault : NSObject, AWSDDLogFormatter

Most users will want file log messages to be prepended with the date and time. Rather than forcing the majority of users to write their own formatter, we will supply a logical default formatter. Users can easily replace this formatter with their own by invoking the setLogFormatter: method. It can also be removed by calling setLogFormatter:, and passing a nil parameter.

In addition to the convenience of having a logical default formatter, it will also provide a template that makes it easy for developers to copy and change.

  • Designated initializer, requires a date formatter

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDateFormatter:
        (nullable NSDateFormatter *)dateFormatter;

    Swift

    init(dateFormatter: DateFormatter?)
  • Convenience initializer

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    convenience init()