We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55caa0f commit ae785f1Copy full SHA for ae785f1
library/src/main/cpp/logging.cpp
@@ -31,9 +31,13 @@ Java_network_loki_messenger_libsession_1util_util_Logger_00024Companion_addLogge
31
return; // Failed to attach thread, cannot log
32
}
33
34
+ // Java strings need null-terminated C strings, we'll have to copy them here unfortunately
35
+ std::string msg_str(msg);
36
+ std::string category_str(category);
37
+
38
env->CallVoidMethod(loggerRef, logMethod,
- JavaLocalRef(env, env->NewStringUTF(msg.data())).get(),
- JavaLocalRef(env, env->NewStringUTF(category.data())).get(),
39
+ JavaLocalRef(env, env->NewStringUTF(msg_str.c_str())).get(),
40
+ JavaLocalRef(env, env->NewStringUTF(category_str.c_str())).get(),
41
static_cast<jint>(level.level)
42
);
43
});
0 commit comments