append logcatch file name for badcase scene

This commit is contained in:
zhongchao
2022-03-17 21:17:15 +08:00
parent 9d4c66e705
commit 646d4d4e2b
5 changed files with 11 additions and 11 deletions

View File

@@ -35,8 +35,8 @@ class DevaToolsProvider : IDevaToolsProvider {
MogoLogCatchManager.startCatchLog()
}
override fun startLogCatch(duration: Int) {
MogoLogCatchManager.startCatchLog(duration)
override fun startLogCatch(duration: Int, logPrefixName: String?) {
MogoLogCatchManager.startCatchLog(duration, logPrefixName)
}
override fun stopLogCatch() {

View File

@@ -10,12 +10,12 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
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.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.ThreadUtils
@@ -103,14 +103,14 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
return false
}
fun startCatchLog(duration: Int = 10) {
fun startCatchLog(duration: Int = 10, logPrefixName: String? = null) {
if (catchingList.contains(MANUAL_CATCH_PKG_NAME)) {
TipToast.shortTip("已经在抓取日志了,请稍后再试")
} else {
CallerLogger.d("$M_DEVA$TAG", "开始抓取日志==== duration : $duration")
manualContent.type = START_CATCH_LOG
manualContent.duration = duration
startCatchLog(manualContent)
startCatchLog(manualContent, logPrefixName)
}
}
@@ -120,7 +120,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
stopCatchLog(manualContent)
}
private fun startCatchLog(content: RemoteLogPushContent) {
private fun startCatchLog(content: RemoteLogPushContent, logPrefixName: String? = null) {
catchingList.add(content.pkgName)
var delay = (content.duration).toLong()
handler.removeMessages(MSG_TRY_CLOSE_LOG)
@@ -136,6 +136,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
mContext,
MoGoAiCloudClientConfig.getInstance().sn,
AppConfigInfo.toString(),
logPrefixName?.replace("_", "-"),
content,
this
)