Log category utility macros

Use these macros to define new log categories and operate on existing ones. More...

Macros

#define KZ_LOG_ENABLED_CATEGORY
 The enabled log category state. More...
 
#define KZ_LOG_DISABLED_CATEGORY
 The disabled log category state. More...
 
#define KZ_LOG_CREATE_CATEGORY(state, name)
 To create new log category, use KZ_LOG_CREATE_CATEGORY macro. More...
 
#define KZ_LOG_GET_CATEGORY_STATE(category)
 To get state of the log category, use KZ_LOG_GET_CATEGORY_STATE macro. More...
 
#define KZ_LOG_GET_CATEGORY_NAME(category)
 To get the name of the log category, use KZ_LOG_GET_CATEGORY_NAME. More...
 
#define KZ_LOG_IS_CATEGORY_ENABLED(category)
 To check if the log category is enabled, use KZ_LOG_IS_CATEGORY_ENABLED. More...
 
#define KZ_LOG_CATEGORY_GENERIC_DEFAULT_STATE
 Define this macro to KZ_LOG_ENABLED_CATEGORY or KZ_LOG_DISABLED_CATEGORY to enable or disable KZ_LOG_CATEGORY_GENERIC category. More...
 

Detailed Description

Use these macros to define new log categories and operate on existing ones.

Macro Definition Documentation

#define KZ_LOG_ENABLED_CATEGORY

The enabled log category state.

#define KZ_LOG_DISABLED_CATEGORY

The disabled log category state.

#define KZ_LOG_CREATE_CATEGORY (   state,
  name 
)

To create new log category, use KZ_LOG_CREATE_CATEGORY macro.

The state parameter, provided by you, determines new log category state. The log category state is used for the log message filtering. See Message classification and filtering. The name parameter you provided is a short string identity of the log category that is passed to the logger when the log message is written. The logger can include the category name to the log message. It depends on the implementation of the logger used to write the log messages. See AbstractLogger for more details.

Parameters
stateThe state of the log category. Set this parameter to KZ_LOG_ENABLED_CATEGORY to enable the log category or set it to KZ_LOG_DISABLED_CATEGORY to disable the log category.
nameThe name of the log category.

See for example KZ_LOG_CATEGORY_GENERIC.

#define KZ_LOG_GET_CATEGORY_STATE (   category)

To get state of the log category, use KZ_LOG_GET_CATEGORY_STATE macro.

For detailed information on the log category state see Log category.

Parameters
categorythe log category.
Returns
State of log category.
#define KZ_LOG_GET_CATEGORY_NAME (   category)

To get the name of the log category, use KZ_LOG_GET_CATEGORY_NAME.

For detailed information on the log category name see KZ_LOG_CREATE_CATEGORY.

Parameters
categoryThe log category.
Returns
The name of log category.
#define KZ_LOG_IS_CATEGORY_ENABLED (   category)

To check if the log category is enabled, use KZ_LOG_IS_CATEGORY_ENABLED.

Parameters
categoryThe log category.
Returns
1 - if category is enabled. 0 - if category is disabled.
#define KZ_LOG_CATEGORY_GENERIC_DEFAULT_STATE

Define this macro to KZ_LOG_ENABLED_CATEGORY or KZ_LOG_DISABLED_CATEGORY to enable or disable KZ_LOG_CATEGORY_GENERIC category.

This macro is used to set the state of the KZ_LOG_DISABLED_CATEGORY. If you do not define this macro before including this header then it will be defined to the value of KZ_LOG_ENABLED_CATEGORY.