[6.5.0]
[fea] [online 写链路日志、tag切换位置]
This commit is contained in:
@@ -37,7 +37,7 @@ object OchChainLogManager {
|
||||
|
||||
|
||||
fun writeChainLogNet(title: String, info: String){
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFO_Net)
|
||||
writeChainLog(title,info,DebugConfig.isDebug(),EVENT_KEY_INFO_Net)
|
||||
}
|
||||
fun writeChainLogInit(title: String, info: String) {
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFO_INIT)
|
||||
|
||||
@@ -23,16 +23,16 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
|
||||
init {
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: 去请求()")
|
||||
if(writeLog || DebugConfig.isDebug()) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "去请求")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "去请求_${tag}")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSuccess(o: T) {
|
||||
super.onSuccess(o)
|
||||
CallerLogger.d("$flavorTag$TAG", "$apiName: onSuccess() ${o.msg}")
|
||||
if(writeLog || DebugConfig.isDebug()) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "请求成功:${o}")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "请求成功:${o}_${tag}")
|
||||
}
|
||||
callback?.onSuccess(o)
|
||||
}
|
||||
@@ -40,8 +40,8 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
override fun onError(e: Throwable) {
|
||||
super.onError(e)
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() ${e.message}")
|
||||
if(writeLog || DebugConfig.isDebug()) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "请求失败:${e.message}")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}", "请求失败:${e.message}_${tag}")
|
||||
}
|
||||
callback?.onError("$apiName: onError() ${e.message}")
|
||||
callback?.onError()
|
||||
@@ -50,10 +50,10 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
override fun onError(message: String, code: Int) {
|
||||
super.onError(message, code)
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() code = $code; message = $message")
|
||||
if(writeLog || DebugConfig.isDebug()) {
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet(
|
||||
"接口:${apiName}_${tag}",
|
||||
"请求失败: onError() code = $code; message = $message\""
|
||||
"接口:${apiName}",
|
||||
"请求失败: onError() code = $code; message = $message\" _${tag}"
|
||||
)
|
||||
}
|
||||
callback?.onFail(code, message)
|
||||
|
||||
Reference in New Issue
Block a user