libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
CMUTIL_LogAppender Struct Reference

Log appender object. More...

Data Fields

const char *(* GetName )(const CMUTIL_LogAppender *appender)
 Get the name of the log appender.
 
void(* SetAsync )(CMUTIL_LogAppender *appender, size_t buffersz)
 Set the log appender to operate in asynchronous mode.
 
void(* Append )(CMUTIL_LogAppender *appender, CMUTIL_Logger *logger, CMLogLevel level, CMUTIL_StringArray *stack, const char *file, int line, CMUTIL_String *logmsg)
 Append a log message to the appender.
 
void(* Flush )(CMUTIL_LogAppender *appender)
 Flush any buffered log messages.
 
void(* Destroy )(CMUTIL_LogAppender *appender)
 Destroy the log appender and free its resources.
 

Detailed Description

Log appender object.

Field Documentation

◆ GetName

const char *(* CMUTIL_LogAppender::GetName) (const CMUTIL_LogAppender *appender)

Get the name of the log appender.

This function retrieves the name of the log appender.

Parameters
appenderA pointer to the CMUTIL_LogAppender object.
Returns
A pointer to a C-style string containing the name of the appender.

◆ SetAsync

void(* CMUTIL_LogAppender::SetAsync) (CMUTIL_LogAppender *appender, size_t buffersz)

Set the log appender to operate in asynchronous mode.

This function configures the log appender to use asynchronous logging with the specified buffer size.

Parameters
appenderA pointer to the CMUTIL_LogAppender object.
bufferszThe size of the buffer for asynchronous logging.

◆ Append

void(* CMUTIL_LogAppender::Append) (CMUTIL_LogAppender *appender, CMUTIL_Logger *logger, CMLogLevel level, CMUTIL_StringArray *stack, const char *file, int line, CMUTIL_String *logmsg)

Append a log message to the appender.

This function appends a log message to the log appender with the specified log level, stack trace, source file, line number, and log message.

Parameters
appenderA pointer to the CMUTIL_LogAppender object.
loggerA pointer to the CMUTIL_Logger object.
levelThe log level for the message.
stackA pointer to a CMUTIL_StringArray containing the stack trace.
fileThe source file name where the log is generated.
lineThe line number in the source file.
logmsgA pointer to a CMUTIL_String containing the log message.

◆ Flush

void(* CMUTIL_LogAppender::Flush) (CMUTIL_LogAppender *appender)

Flush any buffered log messages.

This function flushes any buffered log messages in the log appender to their final destination (e.g., console, file, socket).

Parameters
appenderA pointer to the CMUTIL_LogAppender object.

◆ Destroy

void(* CMUTIL_LogAppender::Destroy) (CMUTIL_LogAppender *appender)

Destroy the log appender and free its resources.

This function releases all resources associated with the log appender and frees any allocated memory.

Parameters
appenderA pointer to the CMUTIL_LogAppender object to be destroyed.

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