[#btck_logging_connection_create]
= btck&lowbar;logging&lowbar;connection&lowbar;create
:mrdocs:

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

== Synopsis

Declared in `&lt;kernel&sol;bitcoinkernel&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard, &lowbar;&lowbar;nonnull&lowbar;&lowbar;&rsqb;&rsqb;
xref:btck_LoggingConnection-04.adoc[btck&lowbar;LoggingConnection]*
btck&lowbar;logging&lowbar;connection&lowbar;create(
    xref:btck_LogCallback.adoc[btck&lowbar;LogCallback] log&lowbar;callback,
    void* user&lowbar;data,
    xref:btck_DestroyCallback.adoc[btck&lowbar;DestroyCallback] user&lowbar;data&lowbar;destroy&lowbar;callback);
----

== Return Value

A new kernel logging connection, or null on error&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *log&lowbar;callback* [in]
| Non&hyphen;null, function through which messages will be logged&period;
| *user&lowbar;data* [in]
| Nullable, holds a user&hyphen;defined opaque structure&period; Is passed back to the user through the callback&period; If the user&lowbar;data&lowbar;destroy&lowbar;callback is also defined it is assumed that ownership of the user&lowbar;data is passed to the created logging connection&period;
| *user&lowbar;data&lowbar;destroy&lowbar;callback* [in]
| Nullable, function for freeing the user data&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
