[6.5.0]
[fea] [接口日志逻辑变更]
This commit is contained in:
@@ -36,8 +36,12 @@ object OchChainLogManager {
|
||||
const val EVENT_KEY_INFO_SOCKET_CONNECT = "analytics_event_och_track_screen_connect"
|
||||
|
||||
|
||||
fun writeChainLogNet(title: String, info: String){
|
||||
writeChainLog(title,info,DebugConfig.isDebug(),EVENT_KEY_INFO_Net)
|
||||
fun writeChainLogNet(mustUpdate: Boolean, title: String, info: String) {
|
||||
if(mustUpdate){
|
||||
writeChainLog(title, info, true, EVENT_KEY_INFO_Net)
|
||||
}else {
|
||||
writeChainLog(title, info, DebugConfig.isDebug(), EVENT_KEY_INFO_Net)
|
||||
}
|
||||
}
|
||||
fun writeChainLogInit(title: String, info: String) {
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFO_INIT)
|
||||
|
||||
@@ -24,7 +24,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
init {
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: 去请求()")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "去请求_${tag}")
|
||||
OchChainLogManager.writeChainLogNet(false,"接口:${apiName}", "去请求_${tag}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
super.onSuccess(o)
|
||||
CallerLogger.d("$flavorTag$TAG", "$apiName: onSuccess() ${o.msg}")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "请求成功:${o}_${tag}")
|
||||
OchChainLogManager.writeChainLogNet(false,"接口:${apiName}", "请求成功:${o}_${tag}")
|
||||
}
|
||||
callback?.onSuccess(o)
|
||||
}
|
||||
@@ -41,7 +41,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
super.onError(e)
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() ${e.message}")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "请求失败:${e.message}_${tag}")
|
||||
OchChainLogManager.writeChainLogNet(false,"接口:${apiName}", "请求失败:${e.message}_${tag}")
|
||||
}
|
||||
callback?.onError("$apiName: onError() ${e.message}")
|
||||
callback?.onError()
|
||||
@@ -52,6 +52,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() code = $code; message = $message")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet(
|
||||
true,
|
||||
"接口:${apiName}",
|
||||
"请求失败: onError() code = $code; message = $message\" _${tag}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user