Added 添加Flutter上报事件日志

This commit is contained in:
axen
2021-11-18 16:59:01 +08:00
parent d61008349a
commit 401c0bfdfe

View File

@ -1,11 +1,10 @@
package com.gh.flutter
import android.util.Log
import com.gh.common.json.JsonObjectBuilder
import com.gh.common.json.json
import com.gh.common.loghub.LoghubUtils
import com.gh.common.tracker.Tracker
import com.gh.common.util.LogUtils
import com.lightgame.utils.Utils
import me.ele.lancet.base.annotations.Insert
import me.ele.lancet.base.annotations.TargetClass
import org.json.JSONObject
@ -31,10 +30,9 @@ class FlutterLogHubServiceImplAop {
@Insert(METHOD_LOG)
fun log(event: String, store: String, extras: Map<String, Any>?) {
val json = build(event)
if (!extras.isNullOrEmpty()) extras.forEach { json.put(it.key, it.value) }
Log.d("FlutterLogHub", "event: $event")
Log.d("FlutterLogHub", "store: $store")
Log.d("FlutterLogHub", "json: $json")
if (!extras.isNullOrEmpty())
extras.forEach { json.put(it.key, it.value) }
Utils.log("NewLogUtils", json.toString(4))
LoghubUtils.log(json, store, false)
}
}