VGF Logging C API

The VGF Library produces logging messages. The Logging C API allows you to process these logging messages. To enable the logging functionality, you must provide the callback function. The callback function accepts log level and message as input parameters:

#include "vgf/logging.h"

void loggingCallback(mlsdk_logging_log_level logLevel, const char* message) {
  // Implementation of the logging callback
}

mlsdk_logging_enable(loggingCallback);

To disable logging, use the following function:

#include "vgf/logging.h"

mlsdk_logging_disable();

C Logging API Reference

enum mlsdk_logging_log_level

Enum for the log levels.

Values:

enumerator mlsdk_logging_log_level_info
enumerator mlsdk_logging_log_level_warning
enumerator mlsdk_logging_log_level_debug
enumerator mlsdk_logging_log_level_error
typedef void (*mlsdk_logging_callback)(mlsdk_logging_log_level logLevel, const char *message)

Type definition for the logging callback.

Param logLevel:

Log level of the message

Param message:

Log message

void mlsdk_logging_enable(mlsdk_logging_callback callback)

Enables logging functionality.

Parameters:
  • callback -- Callback that should be used for processing the log messages

void mlsdk_logging_disable()

Disables logging functionality.