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

Log system object. More...

Data Fields

void(* AddAppender )(const CMUTIL_LogSystem *logsys, CMUTIL_LogAppender *appender)
 Add a log appender to the log system.
 
CMUTIL_ConfLogger *(* CreateLogger )(const CMUTIL_LogSystem *logsys, const char *name, CMLogLevel level, CMBool additivity)
 Create a new logger object.
 
CMUTIL_Logger *(* GetLogger )(const CMUTIL_LogSystem *logsys, const char *name)
 Get a logger by name.
 
void(* Destroy )(CMUTIL_LogSystem *logsys)
 Destroy the log system and free its resources.
 
CMBool(* UpdateEnv )(CMUTIL_LogSystem *logsys)
 Function for updating the environment of the log system.
 

Detailed Description

Log system object.

Field Documentation

◆ AddAppender

void(* CMUTIL_LogSystem::AddAppender) (const CMUTIL_LogSystem *logsys, CMUTIL_LogAppender *appender)

Add a log appender to the log system.

This method will add a log appender to the log system.

Parameters
logsysThe log system object.
appenderThe log appender to be added.

◆ CreateLogger

CMUTIL_ConfLogger *(* CMUTIL_LogSystem::CreateLogger) (const CMUTIL_LogSystem *logsys, const char *name, CMLogLevel level, CMBool additivity)

Create a new logger object.

This method will create a new logger object with the given name, log level, and additivity.

Parameters
logsysThe log system object.
nameThe name of logger. If NULL or empty string is given, a root logger will be created.
levelThe log level of this logger.
additivityIf CMTrue, this logger will also log to parent loggers' appenders.
Returns
The created logger object.

◆ GetLogger

CMUTIL_Logger *(* CMUTIL_LogSystem::GetLogger) (const CMUTIL_LogSystem *logsys, const char *name)

Get a logger by name.

This method retrieves a logger object by its name from the log system.

Parameters
logsysThe log system object.
nameThe name of the logger to retrieve.
Returns
The logger object with the specified name, or NULL if not found.

◆ Destroy

void(* CMUTIL_LogSystem::Destroy) (CMUTIL_LogSystem *logsys)

Destroy the log system and free its resources.

This method releases all resources associated with the log system and frees any allocated memory.

Parameters
logsysA pointer to the CMUTIL_LogSystem object to be destroyed.

◆ UpdateEnv

CMBool(* CMUTIL_LogSystem::UpdateEnv) (CMUTIL_LogSystem *logsys)

Function for updating the environment of the log system.

This function is used to update or reconfigure the environment of a given log system. It allows dynamic changes to the log system's environment settings. Use when a new process is created using a fork.

Parameters
logsysA pointer to the CMUTIL_LogSystem object whose environment should be updated.
Returns
CMTrue on success, CMFalse on failure.

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