fix bug of log switch

This commit is contained in:
zhongchao
2022-03-02 13:25:02 +08:00
parent f441e5051e
commit 10ff1c2e87
3 changed files with 12 additions and 11 deletions

View File

@@ -11,7 +11,6 @@ import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.network.NetConfig
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
@@ -82,7 +81,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
return false
}
fun startCatchLog(duration:Int = 10) {
fun startCatchLog(duration: Int = 10) {
if (catchingList.contains(MANUAL_CATCH_PKG_NAME)) {
TipToast.shortTip("已经在抓取日志了,请稍后再试")
} else {
@@ -156,13 +155,11 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
* 根据状态收紧Logger的限制
*/
private fun closeLoggerLevel() {
if (catchingList.isNotEmpty()) {
LogUtils.getConfig().isLogSwitch = false
Logger.init(if (DebugConfig.isDebug()) LogLevel.DEBUG else LogLevel.OFF)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = false
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotManager.setIsWriteLog(false)
}
LogUtils.getConfig().isLogSwitch = false
Logger.init(if (DebugConfig.isDebug()) LogLevel.DEBUG else LogLevel.OFF)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = false
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotManager.setIsWriteLog(false)
}
override fun onError(errorCount: Int) {

View File

@@ -393,7 +393,11 @@ class DebugSettingView @JvmOverloads constructor(
SharedPrefsMgr.getInstance(context).getBoolean(MoGoConfig.CATCH_LOG, false)
tbLogCatch.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
val logCatchTime = etLogCatch.text.toString().toInt()
var logTimeStr = etLogCatch.text?.toString()
if(logTimeStr.isNullOrEmpty()){
logTimeStr = "10"
}
val logCatchTime = logTimeStr.toInt()
if (logCatchTime > 60) {
tbLogCatch.isChecked = false
TipToast.shortTip("最长抓取时间为60分钟")

View File

@@ -60,7 +60,7 @@ HOOK_LOG_VERSION=1.5.17
SERVICE_CHAIN_VERSION=1.0.53
################ 外部依赖引用 ################
# loglib
LOGLIB_VERSION=1.2.8
LOGLIB_VERSION=1.2.9
######## MogoAiCloudSDK Version ########
# 网络请求
MOGO_NETWORK_VERSION=1.3.31