Kanzi  3.9.6
Kanzi Engine API
kanzi::QnxLogger Class Reference

#include <kanzi/core/platform/log/qnx/qnx_logger.hpp>

Inheritance diagram for kanzi::QnxLogger:
[legend]

Public Member Functions

 QnxLogger (int pageCount, Slog2VerbosityLevel verbosityLevel, uint32_t maxRetries)
 Creates a new slog2 buffer for logging. More...
 
 QnxLogger (void *slog2Buffer)
 Sets the user provided custom slog2 buffer as the logging buffer. More...
 
- 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. More...
 
virtual ~AbstractLogger ()
 Destructor. More...
 

Static Public Member Functions

static void unregisterBuffers ()
 Unregister slog2 buffers. More...
 

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. More...
 

Detailed Description

This is a logger class that writes log messages to QNX slogger2 system logger service.

Constructor & Destructor Documentation

◆ QnxLogger() [1/2]

kanzi::QnxLogger::QnxLogger ( int  pageCount,
Slog2VerbosityLevel  verbosityLevel,
uint32_t  maxRetries 
)

Creates a new slog2 buffer for logging.

Parameters
pageCountHow many 4KB pages to allocate for the slog2 buffer.
verbosityLevelMinimum 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.

◆ QnxLogger() [2/2]

kanzi::QnxLogger::QnxLogger ( void *  slog2Buffer)

Sets the user provided custom slog2 buffer as the logging buffer.

Parameters
slog2BufferUser provided custom slog2_buffer_t buffer registered with slog2_register.

Member Function Documentation

◆ unregisterBuffers()

static void kanzi::QnxLogger::unregisterBuffers ( )
static

Unregister slog2 buffers.

◆ writeOverride()

void kanzi::QnxLogger::writeOverride ( LogLevel  level,
string_view  levelName,
string_view  categoryName,
string_view  fileName,
size_t  lineNumber,
string_view  message 
)
overrideprotectedvirtual

See kanzi::AbstractLogger::writeOverride.

The messages with level = LogLevelError are prepended with fileName and lineNumber.

Parameters
levelThe log level of the message.
levelNameThe string representation of log level.
categoryNameThe string representation of log category.
fileNameThe name of the file log message is originated from.
lineNumberThe line number of the place in file where log message is originated.
messageThe message being written to the log.

Implements kanzi::AbstractLogger.


The documentation for this class was generated from the following file: