|
XVector
|
Log sink registration API for the XVector library. More...
Go to the source code of this file.
Typedefs | |
| typedef enum xvecLogLevel | xvecLogLevel |
| Log severity levels. More... | |
| typedef void(* | xvecLogSinkFn) (xvecLogLevel logLevel, const char *file, uint32_t line, const char *message, void *userData) |
| Log sink callback function type. More... | |
Enumerations | |
| enum | xvecLogLevel { XVEC_LOG_LEVEL_ERROR = 1 , XVEC_LOG_LEVEL_WARN = 2 , XVEC_LOG_LEVEL_INFO = 3 , XVEC_LOG_LEVEL_DEBUG = 4 , XVEC_LOG_LEVEL_TRACE = 5 } |
| Log severity levels. More... | |
Functions | |
| xvecStatus | xvecSetLogSink (xvecLogSinkFn logSink, void *userData) |
| Sets the log sink callback function. More... | |
| xvecStatus | xvecSetLogLevel (xvecLogLevel logLevel) |
| Sets the minimum log level for runtime filtering. More... | |
| xvecLogLevel | xvecGetLogLevel (void) |
| Gets the current runtime log level. More... | |
| const char * | xvecGetLogLevelString (xvecLogLevel logLevel) |
| Gets the string representation of a log level. More... | |
| const char * | xvecGetLogLevelColor (xvecLogLevel logLevel) |
| Gets the ANSI color code for a log level. More... | |
Log sink registration API for the XVector library.
This header provides the public API for registering custom log sink callbacks to receive log messages from the library.
Definition in file xvec_log.h.
| typedef enum xvecLogLevel xvecLogLevel |
Log severity levels.
| typedef void(* xvecLogSinkFn) (xvecLogLevel logLevel, const char *file, uint32_t line, const char *message, void *userData) |
Log sink callback function type.
| logLevel | Severity level of the log message |
| file | Source file name where the log was generated |
| line | Line number in the source file |
| message | Log message string |
| userData | User-provided context data passed to xvecSetLogSink |
Definition at line 57 of file xvec_log.h.
| enum xvecLogLevel |
Log severity levels.
Definition at line 39 of file xvec_log.h.
| xvecLogLevel xvecGetLogLevel | ( | void | ) |
Gets the current runtime log level.
| const char* xvecGetLogLevelColor | ( | xvecLogLevel | logLevel | ) |
Gets the ANSI color code for a log level.
| [in] | logLevel | The log level. |
| const char* xvecGetLogLevelString | ( | xvecLogLevel | logLevel | ) |
Gets the string representation of a log level.
| [in] | logLevel | The log level to convert. |
| xvecStatus xvecSetLogLevel | ( | xvecLogLevel | logLevel | ) |
Sets the minimum log level for runtime filtering.
Only log messages with severity equal to or higher than the specified level will be passed to the log sink. This provides runtime control over log verbosity.
| [in] | logLevel | Minimum log level to output (XVEC_LOG_LEVEL_ERROR is highest priority). |
| XVEC_SUCCESS | Operation completed successfully. |
| xvecStatus xvecSetLogSink | ( | xvecLogSinkFn | logSink, |
| void * | userData | ||
| ) |
Sets the log sink callback function.
Registers a custom callback function to receive log messages from the library. Pass NULL to disable logging output.
| [in] | logSink | Pointer to the log sink callback function, or NULL to disable. |
| [in] | userData | User-provided context data passed to the callback function. |
| XVEC_SUCCESS | Operation completed successfully. |