Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
6348a455
Commit
6348a455
authored
Oct 27, 2016
by
pedroGitt
Browse files
Introduce a new log file (ENABLE_JNI_LOG) to disable/enable logs in JNI side
parent
8dbc2b50
Changes
3
Hide whitespace changes
Inline
Side-by-side
java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp
View file @
6348a455
...
...
@@ -36,9 +36,12 @@ JNIEXPORT void OLM_INBOUND_GROUP_SESSION_FUNC_DEF(releaseSessionJni)(JNIEnv *env
else
{
LOGD
(
" ## releaseSessionJni(): sessionPtr=%p"
,
sessionPtr
);
#ifdef ENABLE_JNI_LOG
size_t
retCode
=
olm_clear_inbound_group_session
(
sessionPtr
);
LOGI
(
" ## releaseSessionJni(): clear_inbound_group_session=%lu"
,
static_cast
<
long
unsigned
int
>
(
retCode
));
LOGD
(
" ## releaseSessionJni(): clear_inbound_group_session=%lu"
,
static_cast
<
long
unsigned
int
>
(
retCode
));
#else
olm_clear_inbound_group_session
(
sessionPtr
);
#endif
LOGD
(
" ## releaseSessionJni(): free IN"
);
free
(
sessionPtr
);
...
...
@@ -111,7 +114,7 @@ JNIEXPORT jint OLM_INBOUND_GROUP_SESSION_FUNC_DEF(initInboundGroupSessionWithSes
sessionResult
=
olm_init_inbound_group_session
(
sessionPtr
,
sessionKeyPtr
,
sessionKeyLength
);
if
(
sessionResult
==
olm_error
())
{
const
char
*
errorMsgPtr
=
olm_inbound_group_session_last_error
(
sessionPtr
);
LOGE
(
" ## initInboundSessionFromIdKeyJni(): failure - init inbound session creation
Msg=%s"
,
errorMsgPtr
);
LOGE
(
" ## initInboundSessionFromIdKeyJni(): failure - init inbound session creation Msg=%s"
,
errorMsgPtr
);
}
else
{
...
...
java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_jni.h
View file @
6348a455
...
...
@@ -28,18 +28,19 @@
#define TAG "OlmJniNative"
/* logging macros */
//#define ENABLE_LOG
S
//#define ENABLE_
JNI_
LOG
#ifdef NDK_DEBUG
#warning "NDK_DEBUG is defined"
#else
#warning "NDK_DEBUG not defined"
#warning NDK_DEBUG is defined!
#endif
#ifdef ENABLE_JNI_LOG
#warning ENABLE_JNI_LOG is defined!
#endif
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__)
#ifdef
NDK_DEBU
G
#ifdef
ENABLE_JNI_LO
G
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, TAG, __VA_ARGS__)
#else
...
...
java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_outbound_group_session.cpp
View file @
6348a455
...
...
@@ -37,8 +37,12 @@ JNIEXPORT void OLM_OUTBOUND_GROUP_SESSION_FUNC_DEF(releaseSessionJni)(JNIEnv *en
{
LOGD
(
" ## releaseSessionJni(): sessionPtr=%p"
,
sessionPtr
);
#ifdef ENABLE_JNI_LOG
size_t
retCode
=
olm_clear_outbound_group_session
(
sessionPtr
);
LOGI
(
" ## releaseSessionJni(): clear_outbound_group_session=%lu"
,
static_cast
<
long
unsigned
int
>
(
retCode
));
LOGD
(
" ## releaseSessionJni(): clear_outbound_group_session=%lu"
,
static_cast
<
long
unsigned
int
>
(
retCode
));
#else
olm_clear_outbound_group_session
(
sessionPtr
);
#endif
LOGD
(
" ## releaseSessionJni(): free IN"
);
free
(
sessionPtr
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment