Kanzi  3.9.9
Kanzi Engine C++ 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

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

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

Unregister slog2 buffers.

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: