Browse Source

JNI-101 - "Use pEpEngine logging API / runtime switchable / thread-safe"

JNI-116 - "pEpLog does not print on Android."
JNI-101
heck 1 year ago
parent
commit
a12f0504a8
2 changed files with 20 additions and 0 deletions
  1. +4
    -0
      src/foundation/pEp/jniadapter/AbstractEngine.java
  2. +16
    -0
      src/foundation_pEp_jniadapter_AbstractEngine.cc

+ 4
- 0
src/foundation/pEp/jniadapter/AbstractEngine.java View File

@ -35,6 +35,10 @@ abstract class AbstractEngine extends UniquelyIdentifiable implements AutoClosea
}
}
// libpEpAdapter based logging using pEpEngine logging API
public native static void setDebugLogEnabled(boolean enabled);
public native static boolean getDebugLogEnabled();
public native String getVersion();
public native String getProtocolVersion();


+ 16
- 0
src/foundation_pEp_jniadapter_AbstractEngine.cc View File

@ -265,6 +265,22 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_release(
Adapter::session(pEp::Adapter::release);
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_setDebugLogEnabled(
JNIEnv *env,
jclass clazz,
jboolean enabled)
{
Adapter::pEpLog::set_enabled(static_cast<bool>(enabled));
}
JNIEXPORT jboolean JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_getDebugLogEnabled(
JNIEnv *env,
jclass clazz
)
{
return static_cast<jboolean>(Adapter::pEpLog::get_enabled());
}
JNIEXPORT jstring JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_getVersion(
JNIEnv *env,
jobject obj


Loading…
Cancel
Save