AWSDDContextAllowlistFilterLogFormatter

Objective-C

@interface AWSDDContextAllowlistFilterLogFormatter
    : NSObject <AWSDDLogFormatter>

Swift

class AWSDDContextAllowlistFilterLogFormatter : NSObject, AWSDDLogFormatter

This class provides a log formatter that filters log statements from a logging context not on the allowlist.

A log formatter can be added to any logger to format and/or filter its output. You can learn more about log formatters here: Documentation/CustomFormatters.md

You can learn more about logging context’s here: Documentation/CustomContext.md

But here’s a quick overview / refresher:

Every log statement has a logging context. These come from the underlying logging macros defined in AWSDDLog.h. The default logging context is zero. You can define multiple logging context’s for use in your application. For example, logically separate parts of your app each have a different logging context. Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context.

  • Designated default initializer

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Add a context to the allowlist

    Declaration

    Objective-C

    - (void)addToAllowlist:(NSInteger)loggingContext;

    Swift

    func add(toAllowlist loggingContext: Int)

    Parameters

    loggingContext

    the context

  • Remove context from allowlist

    Declaration

    Objective-C

    - (void)removeFromAllowlist:(NSInteger)loggingContext;

    Swift

    func remove(fromAllowlist loggingContext: Int)

    Parameters

    loggingContext

    the context

  • Return the allowlist

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<NSNumber *> *_Nonnull allowlist;

    Swift

    var allowlist: [NSNumber] { get }
  • Check if a context is on the allowlist

    Declaration

    Objective-C

    - (BOOL)isOnAllowlist:(NSInteger)loggingContext;

    Swift

    func `is`(onAllowlist loggingContext: Int) -> Bool

    Parameters

    loggingContext

    the context

Deprecated

  • Deprecated

    Use -addToAllowlist: instead

    Add a context to the whitelist @deprecated Use -addToAllowlist: instead.

    Declaration

    Objective-C

    - (void)addToWhitelist:(NSInteger)loggingContext;

    Swift

    func add(toWhitelist loggingContext: Int)

    Parameters

    loggingContext

    the context

  • Deprecated

    Use -removeFromAllowlist: instead

    Remove context from whitelist @deprecated Use -removeFromAllowlist: instead.

    Declaration

    Objective-C

    - (void)removeFromWhitelist:(NSInteger)loggingContext;

    Swift

    func remove(fromWhitelist loggingContext: Int)

    Parameters

    loggingContext

    the context

  • Deprecated

    Use allowlist instead

    Return the whitelist @deprecated Use allowlist instead.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<NSNumber *> *_Nonnull whitelist;

    Swift

    var whitelist: [NSNumber] { get }
  • Deprecated

    Use -isOnAllowlist: instead

    Check if a context is on the whitelist @deprecated Use -isOnAllowlist: instead.

    Declaration

    Objective-C

    - (BOOL)isOnWhitelist:(NSInteger)loggingContext;

    Swift

    func `is`(onWhitelist loggingContext: Int) -> Bool

    Parameters

    loggingContext

    the context