btck_logging_connection_create

Start logging messages through the provided callback. Log messages produced before this function is first called are buffered and on calling this function are logged immediately.

Synopsis

Declared in <kernel/bitcoinkernel.h>

[[nodiscard, __nonnull__]]
btck_LoggingConnection*
btck_logging_connection_create(
    btck_LogCallback log_callback,
    void* user_data,
    btck_DestroyCallback user_data_destroy_callback);

Return Value

A new kernel logging connection, or null on error.

NOTE

The return value should not be discarded.

Parameters

NameDescription
log_callback [in]Non-null, function through which messages will be logged.
user_data [in]Nullable, holds a user-defined opaque structure. Is passed back to the user through the callback. If the user_data_destroy_callback is also defined it is assumed that ownership of the user_data is passed to the created logging connection.
user_data_destroy_callback [in]Nullable, function for freeing the user data.