Compare commits

...

3 Commits

Author SHA1 Message Date
30f96b780b
disable lan 2023-12-16 20:44:23 +01:00
85a06de59a
lower log level 2023-12-16 20:36:41 +01:00
6b5f40b4a0
add temp log callback 2023-12-16 19:13:49 +01:00
2 changed files with 11 additions and 2 deletions

View File

@ -164,9 +164,10 @@ configure_file(
target_include_directories(toxcore PRIVATE "${TOX_DIR}toxcore")
target_include_directories(toxcore PUBLIC "${TOX_DIR}")
target_compile_definitions(toxcore PUBLIC USE_IPV6=1)
#target_compile_definitions(toxcore PUBLIC USE_IPV6=1)
target_compile_definitions(toxcore PUBLIC MIN_LOGGER_LEVEL=LOGGER_LEVEL_TRACE)
#target_compile_definitions(toxcore PUBLIC MIN_LOGGER_LEVEL=LOGGER_LEVEL_DEBUG)
target_compile_definitions(toxcore PUBLIC MIN_LOGGER_LEVEL=LOGGER_LEVEL_INFO)
#target_compile_definitions(toxcore PUBLIC MIN_LOGGER_LEVEL=LOGGER_LEVEL_INFO)
find_package(unofficial-sodium CONFIG QUIET)
find_package(sodium QUIET)

View File

@ -1,4 +1,5 @@
#include "./tox_client.hpp"
#include "toxcore/tox.h"
// meh, change this
#include <exception>
@ -18,6 +19,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 +72,9 @@ ToxClient::ToxClient(std::string_view save_path, std::string_view save_password)
}
}
tox_options_set_local_discovery_enabled(options, false);
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);