#include <kanzi/core/platform/log/qnx/qnx_logger.hpp>
Public Member Functions | |
QnxLogger (int pageCount, Slog2VerbosityLevel verbosityLevel, uint32_t maxRetries) | |
Creates a new slog2 buffer for logging. | |
QnxLogger (void *slog2Buffer) | |
Sets the user provided custom slog2 buffer as the logging buffer. | |
Public Member Functions inherited from kanzi::AbstractLogger | |
void | write (LogLevel level, string_view levelName, string_view categoryName, string_view fileName, size_t lineNumber, string_view message) |
Kanzi calls this function to store the message to the log. | |
virtual | ~AbstractLogger () |
Destructor. | |
Static Public Member Functions | |
static void | unregisterBuffers () |
Unregister slog2 buffers. | |
Protected Member Functions | |
void | writeOverride (LogLevel level, string_view levelName, string_view categoryName, string_view fileName, size_t lineNumber, string_view message) override |
See kanzi::AbstractLogger::writeOverride. | |
This is a logger class that writes log messages to QNX slogger2 system logger service.
kanzi::QnxLogger::QnxLogger | ( | int | pageCount, |
Slog2VerbosityLevel | verbosityLevel, | ||
uint32_t | maxRetries ) |
Creates a new slog2 buffer for logging.
pageCount | How many 4KB pages to allocate for the slog2 buffer. |
verbosityLevel | Minimum slog2 severity to log. |
maxRetries | (QNX Neutrino 7.0.4 and later) The number of times slogger2 retries to obtain a buffer. If this limit is reached, the log message will be dropped. If maxRetries is set to Slog2UnlimitedRetries, no limit is imposed on how many times slogger2 retries to obtain buffer. |
kanzi::QnxLogger::QnxLogger | ( | void * | slog2Buffer | ) |
Sets the user provided custom slog2 buffer as the logging buffer.
slog2Buffer | User provided custom slog2_buffer_t buffer registered with slog2_register. |
|
overrideprotectedvirtual |
See kanzi::AbstractLogger::writeOverride.
The messages with level
= LogLevelError are prepended with fileName
and lineNumber
.
level | The log level of the message. |
levelName | The string representation of log level. |
categoryName | The string representation of log category. |
fileName | The name of the file log message is originated from. |
lineNumber | The line number of the place in file where log message is originated. |
message | The message being written to the log. |
Implements kanzi::AbstractLogger.