清霜辰-博客

安卓增加mediasoup webrtc 日志输出

[TOC]

本文首发地址 https://h89.cn/archives/246.html
最新更新地址 https://gitee.com/chenjim/chenjimblog

增加 webrtc 日志

修改 mediasoup-client/src/main/jni/jni_onload.cpp 如下

@@ -12,6 +12,7 @@ extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM* jvm, void* reserved)
  if (ret < 0)
    return -1;

+    rtc::LogMessage::LogToDebug(rtc::LoggingSeverity::LS_INFO);
  mediasoupclient::Initialize();
  webrtc::jni::LoadGlobalClassReferenceHolder();
  return JNI_VERSION_1_6;

参考自 https://github.com/lihuan545890/mediasoup-client-android/


增加 libmediasoupclient 日志

修改 \mediasoup-client-android\mediasoup-client\deps\libmediasoupclient\src\Logger.cpp

-   Logger::LogLevel Logger::logLevel = Logger::LogLevel::LOG_NONE;
+   Logger::LogLevel Logger::logLevel = Logger::LogLevel::LOG_TRACE;

修改 mediasoup-client-android\mediasoup-client\deps\libmediasoupclient\include\Logger.hpp

-  if (Logger::handler && Logger::logLevel == Logger::LogLevel::LOG_DEBUG) \
+  if (Logger::handler && Logger::logLevel >= Logger::LogLevel::LOG_DEBUG) \

增加 mediasoup-client 日志

修改
mediasoup-client-android\mediasoup-client\src\main\java\org\mediasoup\droid\Logger.java

-    Logger.setLogLevel(Logger.LogLevel.LOG_DEBUG);
+    Logger.setLogLevel(Logger.LogLevel.LOG_TRACE);

其它相关文档

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »