Log level utility macros

Use these macros to define new log levels and operate on defined log levels. More...

Macros

#define KZ_LOG_CREATE_LEVEL(value, name)
 Creates new log level. More...
 
#define KZ_LOG_GET_LEVEL_VALUE(level)
 To get log level value, use KZ_LOG_GET_LEVEL_VALUE. More...
 
#define KZ_LOG_GET_LEVEL_NAME(level)
 To get the log level name, use KZ_LOG_GET_LEVEL_NAME. More...
 
#define KZ_LOG_IS_LEVEL_ENABLED(level)
 To check if the log level is enabled, use KZ_LOG_IS_LEVEL_ENABLED. More...
 

Detailed Description

Use these macros to define new log levels and operate on defined log levels.

Macro Definition Documentation

#define KZ_LOG_CREATE_LEVEL (   value,
  name 
)

Creates new log level.

This macro is used to define new log level. See KZ_LOG_LEVEL_INFO definition for an example. The value parameter that you provide is unique integer value assigned to the new log level to implement the log level ordering. The value assigned is used in log message filtering as described in Message classification and filtering section. The name of log level you provide in in name parameter is used by the logger when writing messages to the log. See AbstractLogger for more details.

Parameters
valueUnique integer value used to implement the log level ordering. For details, see Log Level.
nameThe name of the log level.
#define KZ_LOG_GET_LEVEL_VALUE (   level)

To get log level value, use KZ_LOG_GET_LEVEL_VALUE.

See KZ_LOG_CREATE_LEVEL for details.

Parameters
levelThe log level.
Returns
The value used to implement log level ordering. For details, see Log Level.
#define KZ_LOG_GET_LEVEL_NAME (   level)

To get the log level name, use KZ_LOG_GET_LEVEL_NAME.

See KZ_LOG_CREATE_LEVEL for details.

Parameters
levelThe level macro (see KZ_LOG_LEVEL_ERROR for example).
Returns
Short string describing log level.
#define KZ_LOG_IS_LEVEL_ENABLED (   level)

To check if the log level is enabled, use KZ_LOG_IS_LEVEL_ENABLED.

For details see KZ_LOG_CREATE_LEVEL macro and Log Level.

Parameters
levelThe log level.
Returns
1 - if level is enabled. 0 - if level is disabled.