From 6b5f40b4a0d91e23a41c7b271c898bee9ad9e10c Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sat, 16 Dec 2023 19:13:49 +0100 Subject: [PATCH] add temp log callback --- src/tox_client.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tox_client.cpp b/src/tox_client.cpp index e015a1d..5fe8765 100644 --- a/src/tox_client.cpp +++ b/src/tox_client.cpp @@ -18,6 +18,10 @@ static void eee(std::string& mod) { } } +static void tmp_tox_log_cb(Tox *tox, Tox_Log_Level level, const char *file, uint32_t line, const char *func, const char *message, void *user_data) { + std::cerr << "l:" << level << " " << file << ":" << line << "@" << func << ": '" << message << "'\n"; +} + ToxClient::ToxClient(std::string_view save_path, std::string_view save_password) : _tox_profile_path(save_path), _tox_profile_password(save_password) { @@ -67,6 +71,8 @@ ToxClient::ToxClient(std::string_view save_path, std::string_view save_password) } } + tox_options_set_log_callback(options, tmp_tox_log_cb); + TOX_ERR_NEW err_new; _tox = tox_new(options, &err_new); tox_options_free(options);