summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_core.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-04-13 22:54:05 +0300
committeraunsane <aunsane@gmail.com>2018-04-13 22:54:27 +0300
commit430f999f00224a68a967e7122894b469d5ee60bf (patch)
treeb552ff57e5c8a0f1de49208eb511f4edb38f2032 /protocols/Tox/src/tox_core.cpp
parent81dd07b3ae0c7f31da0c6766b8b325e2601e4195 (diff)
Tox: added logging from toxcore
- toxcore updated to 0.2.1 - toxcore now bootstraped with random two nodes - version bump
Diffstat (limited to 'protocols/Tox/src/tox_core.cpp')
-rw-r--r--protocols/Tox/src/tox_core.cpp11
1 files changed, 11 insertions, 0 deletions
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