Protocols

The following protocols are available globally.

DDAtomicCountable

  • Deprecated

    DDAtomicCountable is useless since DDDispatchQueueLogFormatter is always shareable now

    Undocumented

    See more

    Declaration

    Objective-C

    @protocol DDAtomicCountable <NSObject>
    
    - (instancetype)initWithDefaultValue:(int32_t)defaultValue;
    - (int32_t)increment;
    - (int32_t)decrement;
    - (int32_t)value;
    
    @end

    Swift

    protocol DDAtomicCountable : NSObjectProtocol
  • The LogFileManager protocol is designed to allow you to control all aspects of your log files.

    The primary purpose of this is to allow you to do something with the log files after they have been rolled. Perhaps you want to compress them to save disk space. Perhaps you want to upload them to an FTP server. Perhaps you want to run some analytics on the file.

    A default LogFileManager is, of course, provided. The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property.

    This protocol provides various methods to fetch the list of log files.

    There are two variants: sorted and unsorted. If sorting is not necessary, the unsorted variant is obviously faster. The sorted variant will return an array sorted by when the log files were created, with the most recently created log file at index 0, and the oldest log file at the end of the array.

    You can fetch only the log file paths (full path including name), log file names (name only), or an array of DDLogFileInfo objects. The DDLogFileInfo class is documented below, and provides a handy wrapper that gives you easy access to various file attributes such as the creation date or the file size.

    See more

    Declaration

    Objective-C

    @protocol DDLogFileManager <NSObject>

    Swift

    protocol DDLogFileManager : NSObjectProtocol
  • This protocol describes a basic logger behavior. Basically, it can log messages, store a logFormatter plus a bunch of optional behaviors. (i.e. flush, get its loggerQueue, get its name, …

    See more

    Declaration

    Objective-C

    @protocol DDLogger <NSObject>

    Swift

    protocol DDLogger : NSObjectProtocol
  • This protocol describes the behavior of a log formatter

    See more

    Declaration

    Objective-C

    @protocol DDLogFormatter <NSObject>

    Swift

    protocol DDLogFormatter : NSObjectProtocol
  • This protocol describes a dynamic logging component

    See more

    Declaration

    Objective-C

    @protocol DDRegisteredDynamicLogging

    Swift

    protocol DDRegisteredDynamicLogging