Declared in DDLog.h

DDLogFlag

Define the standard options.

We default to only 4 levels because it makes it easier for beginners to make the transition to a logging framework.

More advanced users may choose to completely customize the levels (and level names) to suite their needs. For more information on this see the “Custom Log Levels” page: Documentation/CustomLogLevels.md

Advanced users may also notice that we’re using a bitmask. This is to allow for custom fine grained logging: Documentation/FineGrainedLogging.md

– Flags –

Typically you will use the LOG_LEVELS (see below), but the flags may be used directly in certain situations. For example, say you have a lot of warning log messages, and you wanted to disable them. However, you still needed to see your error and info log messages. You could accomplish that with the following:

static const DDLogLevel ddLogLevel = DDLogFlagError | DDLogFlagInfo;

When LOG_LEVEL_DEF is defined as ddLogLevel.

Flags may also be consulted when writing custom log formatters, as the DDLogMessage class captures the individual flag that caused the log message to fire.

– Levels –

Log levels are simply the proper bitmask of the flags.

– Booleans –

The booleans may be used when your logging code involves more than one line. For example:

if (LOG_VERBOSE) { for (id sprocket in sprockets) DDLogVerbose(@“sprocket: %@”, [sprocket description]) }

– Async –

Defines the default asynchronous options. The default philosophy for asynchronous logging is very simple:

Log messages with errors should be executed synchronously. After all, an error just occurred. The application could be unstable.

All other log messages, such as debug output, are executed asynchronously. After all, if it wasn’t an error, then it was just informational output, or something the application was easily able to recover from.

– Changes –

You are strongly discouraged from modifying this file. If you do, you make it more difficult on yourself to merge future bug fixes and improvements from the project. Instead, create your own MyLogging.h or ApplicationNameLogging.h or CompanyLogging.h

For an example of customizing your logging experience, see the “Custom Log Levels” page: Documentation/CustomLogLevels.md

Definition

typedef NS_OPTIONS(NSUInteger, DDLogFlag ) {
   DDLogFlagError = ( 1 < < 0 ),
   DDLogFlagWarning = ( 1 < < 1 ),
   DDLogFlagInfo = ( 1 < < 2 ),
   DDLogFlagDebug = ( 1 < < 3 ),
   DDLogFlagVerbose = ( 1 < < 4 ),
};

Constants

DDLogFlagError

Define the standard options.

DDLog.h.

DDLogFlagWarning

Define the standard options.

DDLog.h.

DDLogFlagInfo

Define the standard options.

DDLog.h.

DDLogFlagDebug

Define the standard options.

DDLog.h.

DDLogFlagVerbose

Define the standard options.

DDLog.h.

Declared In

DDLog.h