Logging

This secion presents the logging options available to diagnose issues during development or deployment.

Initialize Logging

The logging options are configured when calling ic4_init_library.

To configure logging, pass an initialized IC4_INIT_CONFIG struct:

The IC4_INIT_CONFIG::api_log_level member configures the logging of errors and warnings from API functions. It is recommended to set this to IC4_LOG_WARN during development to detect possible API usage errors as early as possible.

The IC4_INIT_CONFIG::internal_log_level member can be used to enable internal logging. This is mostly useful to debug unexpected behavior and should be used carefully, as it can slow down operation.

The IC4_INIT_CONFIG::log_targets member defines where the log output will be written to. When using Microsoft Visual Studio, setting this to IC4_LOGTARGET_WINDEBUG is recommended to receive log output in the debugger's output window. It is also possible to direct logging messages to IC4_LOGTARGET_STDOUT or a log file. Multiple log targets can be enabled at the same time by forming a bitwise combination of IC4_LOG_TARGET_FLAGS.