APP_TRACE Macros

These macros wrap calls to various OSLog API. They are presented primarily as an example of how to use OSLog API. As defined in OSSystemLog.h, the implementation of these macros are enabled only when APP_TRACE_ENABLED is defined. SDK users may use these macros, or create their own by directly referencing the OSLog API.

APP_KEYTRACE_3ARG, APP_KEYTRACE_2ARG, APP_KEYTRACE_1ARG, APP_KEYTRACE_0ARG

Description

Utilizing OSLogArgs, these macros allow a single keyword and zero to three arbitrary word arguments to be logged. Category OS_LOG_CATEGORY_OS and level OS_LOG_LEVEL_NOTICE are assumed.

Macro Arguments

_seqByte _ Sequence byte associated with the logged event. When one wants trace specific sections of executed logic it can be helpful to repeat the same event, varying only a sequence number. Only the least significant 8 bits of this unsigned argument are valid at this time.
_key_ Four 8-bit ASCII characters which are treated as a keyword when the log is displayed.
_arg0_,...,_arg2 _ Up to three argument words.

APP_TRACE_0ARG_OPT, APP_TRACE_1ARG_OPT, APP_TRACE_2ARG_OPT, APP_TRACE_3ARG_OPT, APP_TRACE_4ARG_OPT, APP_TRACE_5ARG_OPT, APP_TRACE_6ARG_OPT, APP_TRACE_7ARG_OPT, APP_TRACE_8ARG_OPT

Description

Utilizing OSLogFunc, these macros log a function name, source file line number and up to eight arbitrary word arguments. Category, level and options are passed as arguments.

Macro Arguments

_cat_ This argument identifies the category to which the logged event belongs. For information, see System Logging Overview.
_level_ Level at which event is logged. For information, see System Logging Overview.
_opt_ Bitmap of options providing metadata about the information being logged. Valid option masks include: OS_LOG_DATA_OPT_FUNC_ENTER_MASK, OS_LOG_DATA_OPT_FUNC_EXIT_MASK. For information, see System Logging Overview.
_arg0_,...,_arg7 _ Up to eight argument words.

APP_TRACE_1ARG, APP_TRACE_2ARG, APP_TRACE_3ARG, APP_TRACE_4ARG, APP_TRACE_5ARG, APP_TRACE_6ARG, APP_TRACE_7ARG, APP_TRACE_8ARG

Description

Utilizing OSLogFunc, these macros log a function name, source file line number and up to eight arbitrary word arguments. Category OS_LOG_CATEGORY_APP and level OS_LOG_LEVEL_NOTICE are assumed.

Macro Arguments

_arg0_,...,_arg7_ Up to eight argument words.

APP_TRACE_ENTER, APP_TRACE_ENTER_1ARG, APP_TRACE_ENTER_2ARG, APP_TRACE_ENTER_3ARG, APP_TRACE_ENTER_4ARG, APP_TRACE_ENTER_5ARG, APP_TRACE_ENTER_6ARG, APP_TRACE_ENTER_7ARG, APP_TRACE_ENTER_8ARG

Description

Utilizing OSLogFunc, these macros log a function name, source file line number and up to eight arbitrary word arguments. These macros have ENTER in the name because they internally set the OS_LOG_DATA_OPT_FUNC_ENTER_MASK option, which causes a function entry note to be listed when the log is later displayed. Category OS_LOG_CATEGORY_APP and level OS_LOG_LEVEL_NOTICE are assumed.

Macro Arguments

_arg0_,...,_arg7_   Up to eight argument words.

APP_TRACE_EXIT, APP_TRACE_EXIT_1ARG, APP_TRACE_EXIT_2ARG, APP_TRACE_EXIT_3ARG, APP_TRACE_EXIT_4ARG, APP_TRACE_EXIT_5ARG, APP_TRACE_EXIT_6ARG, APP_TRACE_EXIT_7ARG, APP_TRACE_EXIT_8ARG

Description

Utilizing OSLogFunc, these macros log a function name, source file line number and up to eight arbitrary word arguments. These macros have EXIT in the name because they internally set the OS_LOG_DATA_OPT_FUNC_EXIT_MASK option, which causes a function exit note to be listed when the log is later displayed. Category OS_LOG_CATEGORY_APP and level OS_LOG_LEVEL_NOTICE are assumed.

Macro Arguments

_arg0_,...,_arg7_   Up to eight argument words.

Revision History

2013/05/08 Automated cleanup pass.
2012/08/02 Cleanup Pass.
2012/05/23 Initial version.


CONFIDENTIAL