[6.2.0][技术优化] 基于apm平台添加日志回捞能力
This commit is contained in:
@@ -102,6 +102,10 @@ dependencies {
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:mogo-core-res')
|
||||
|
||||
if (!rootProject.isJunkDetectEnable()) {
|
||||
compileOnly rootProject.ext.dependencies.apm_insight
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -4,6 +4,7 @@ import android.content.*
|
||||
import android.util.*
|
||||
import android.view.*
|
||||
import androidx.metrics.performance.*
|
||||
import com.apm.insight.log.VLog
|
||||
import com.mogo.eagle.core.block.runtime.*
|
||||
import com.mogo.eagle.core.block.runtime.config.*
|
||||
import com.mogo.eagle.core.block.runtime.config.recorder.*
|
||||
@@ -17,6 +18,10 @@ import java.util.concurrent.TimeUnit.SECONDS
|
||||
|
||||
internal class MoGoBlockProviderImpl: IMoGoBlockProvider, IBlockListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BLOCK_REPORT"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var hasInit = false
|
||||
|
||||
@@ -64,7 +69,13 @@ internal class MoGoBlockProviderImpl: IMoGoBlockProvider, IBlockListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
linkedLog.record(GsonUtils.toJson(map))
|
||||
val msg = GsonUtils.toJson(map)
|
||||
try {
|
||||
VLog.w(TAG, msg)
|
||||
} catch (t: Throwable) {
|
||||
Log.e(TAG, "onDumped error", t)
|
||||
}
|
||||
linkedLog.record(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user