Use logging macros to write messages to the log. More...
Macros | |
#define | kzLog(logger, level, category, message) |
To use custom logger to write log messages, use kzLog macro. More... | |
#define | kzLogError(category, message) |
To write error log messages with the Default Logger, use kzLogError macro. More... | |
#define | kzLogWarning(category, message) |
To write warning log messages with the Default Logger, use kzLogWarning macro. More... | |
#define | kzLogInfo(category, message) |
To write info log messages with the Default Logger, use kzLogInfo macro. More... | |
#define | kzLogTrace(category, message) |
To write trace log messages with the Default Logger, use kzLogTrace macro. More... | |
#define | kzLogDebug(message) |
To write debug log messages with the Default Logger, use kzLogDebug macro. More... | |
Use logging macros to write messages to the log.
These macros are used to implement compile-time message filtering described in Message classification and filtering.
#define kzLog | ( | logger, | |
level, | |||
category, | |||
message | |||
) |
To use custom logger to write log messages, use kzLog macro.
This macro assigns the log level
and the log category
to the message and writes it to the log using the logger
you provided. If you want to use your logger to write all the application log messages, register your logger within the Default Logger (see kanzi::DefaultLogger).
logger | The logger you want to use to write the message to the log. |
level | The log level of the message. |
category | The log category of the message. |
message | The message. For format description see LogMessageStructureSection. |
To implement your own logger:
To use your own logger to write a message to the log:
#define kzLogError | ( | category, | |
message | |||
) |
To write error log messages with the Default Logger, use kzLogError macro.
This macro assigns KZ_LOG_LEVEL_ERROR log level and the log category
you provided to the message. For more information about the Default Logger, see kanzi::DefaultLogger.
category | The log category assigned to the message. |
message | The message. For format description see LogMessageStructureSection. |
To write the error message to the log:
#define kzLogWarning | ( | category, | |
message | |||
) |
To write warning log messages with the Default Logger, use kzLogWarning macro.
This macro assigns KZ_LOG_LEVEL_WARNING log level and the log category
you provided to the message. For more information about the Default Logger, see kanzi::DefaultLogger.
category | The log category assigned to the message. |
message | The message. For format description see LogMessageStructureSection. |
To write the warning message to the log:
#define kzLogInfo | ( | category, | |
message | |||
) |
To write info log messages with the Default Logger, use kzLogInfo macro.
This macro assigns KZ_LOG_LEVEL_INFO log level and the log category
you provided to the message. For more information about the Default Logger, see kanzi::DefaultLogger.
category | The log category assigned to the message. |
message | The message. For format description see LogMessageStructureSection. |
To write the info message to the log:
#define kzLogTrace | ( | category, | |
message | |||
) |
To write trace log messages with the Default Logger, use kzLogTrace macro.
This macro assigns KZ_LOG_LEVEL_TRACE log level and the log category
you provided to the message. For more information about the Default Logger, see kanzi::DefaultLogger.
category | The log category assigned to the message. |
message | The message. For format description see LogMessageStructureSection. |
To write the trace message to the log:
#define kzLogDebug | ( | message | ) |
To write debug log messages with the Default Logger, use kzLogDebug macro.
This macro assigns KZ_LOG_LEVEL_INFO log level and KZ_LOG_CATEGORY_DEBUG log category to the message. For more information about the Default Logger, see kanzi::DefaultLogger.
message | The message. For format description see LogMessageStructureSection. |
To write the debug message to the log: