调试窗

日志中心增加网络日志输出控制
This commit is contained in:
xuxinchao
2022-04-18 19:38:13 +08:00
parent 00ef4cca6d
commit 5210e3dd87
3 changed files with 21 additions and 1 deletions

View File

@@ -194,6 +194,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
private fun openLoggerLevel() {
Logger.init(LogLevel.DEBUG)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = true
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = true
CallerAutoPilotManager.setEnableLog(true)
}
@@ -203,6 +204,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
private fun closeLoggerLevel() {
Logger.init(if (DebugConfig.isDebug()) LogLevel.DEBUG else LogLevel.OFF)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = false
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = false
CallerAutoPilotManager.setEnableLog(false)
}

View File

@@ -14,6 +14,7 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import chassis.Chassis
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
@@ -1031,6 +1032,13 @@ class DebugSettingView @JvmOverloads constructor(
}
}
/**
* 设置是否输出网络日志 true-打印日志false-不打印日志
*/
tbNetLog.setOnCheckedChangeListener { _, isChecked ->
MoGoAiCloudClientConfig.getInstance().isShowNetDebugLog = isChecked
}
cbTraceLog.isChecked = CallerDevaToolsManager.getTraceLogStatus()
//链路Log输出日志
cbTraceLog.setOnCheckedChangeListener { _, isChecked ->
@@ -1659,7 +1667,6 @@ class DebugSettingView @JvmOverloads constructor(
}
override fun onLocationChanged(location: MogoLocation?, from: Int) {
}
/**

View File

@@ -1421,6 +1421,17 @@
android:textOn="关闭日志过滤面板"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbNetLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="打开「网络」Log"
android:textOn="关闭「网络」Log"
android:textSize="@dimen/dp_24"
/>
</com.google.android.flexbox.FlexboxLayout>
<com.google.android.flexbox.FlexboxLayout