Inherits from NSObject
Conforms to DDLogger
Declared in DDLog.h

Overview

The DDLogger protocol specifies that an optional formatter can be added to a logger. Most (but not all) loggers will want to support formatters.

However, writting getters and setters in a thread safe manner, while still maintaining maximum speed for the logging process, is a difficult task.

To do it right, the implementation of the getter/setter has strict requiremenets: - Must NOT require the logMessage method to acquire a lock. - Must NOT require the logMessage method to access an atomic property (also a lock of sorts).

To simplify things, an abstract logger is provided that implements the getter and setter.

Logger implementations may simply extend this class, and they can ACCESS THE FORMATTER VARIABLE DIRECTLY from within their logMessage method!

Tasks

Properties

logFormatter

@property (nonatomic, strong) id<DDLogFormatter> logFormatter
Discussion

Formatters may optionally be added to any logger.

If no formatter is set, the logger simply logs the message as it is given in logMessage, or it may use its own built in formatting style.

Declared In

DDLog.h

loggerQueue

@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE) dispatch_queue_t loggerQueue
Discussion

Each logger is executed concurrently with respect to the other loggers. Thus, a dedicated dispatch queue is used for each logger. Logger implementations may optionally choose to provide their own dispatch queue.

Declared In

DDLog.h

onGlobalLoggingQueue

@property (nonatomic, readonly, getter=isOnGlobalLoggingQueue) BOOL onGlobalLoggingQueue

onInternalLoggerQueue

@property (nonatomic, readonly, getter=isOnInternalLoggerQueue) BOOL onInternalLoggerQueue