From 430f999f00224a68a967e7122894b469d5ee60bf Mon Sep 17 00:00:00 2001 From: aunsane Date: Fri, 13 Apr 2018 22:54:05 +0300 Subject: Tox: added logging from toxcore - toxcore updated to 0.2.1 - toxcore now bootstraped with random two nodes - version bump --- protocols/Tox/src/tox_core.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'protocols/Tox/src/tox_core.cpp') diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp index de977b090f..1132486213 100644 --- a/protocols/Tox/src/tox_core.cpp +++ b/protocols/Tox/src/tox_core.cpp @@ -36,6 +36,9 @@ Tox_Options* CToxProto::GetToxOptions() } } + options->log_callback = CToxProto::OnToxLog; + options->log_user_data = this; + if (LoadToxProfile(options)) return options; @@ -93,3 +96,11 @@ void CToxProto::UninitToxCore(Tox *tox) CancelAllTransfers(tox); SaveToxProfile(tox); } + +void CToxProto::OnToxLog(Tox*, TOX_LOG_LEVEL level, const char *file, uint32_t line, const char *func, const char *message, void *user_data) +{ + CToxProto *proto = (CToxProto*)user_data; + + if (level > TOX_LOG_LEVEL_INFO) + proto->debugLogA("TOXCORE: %s at %s(...) in %s:%u", message, func, file, line); +} \ No newline at end of file -- cgit v1.2.3