[fea]
[online 写链路日志、tag切换位置]
This commit is contained in:
yangyakun
2024-07-23 14:09:37 +08:00
parent 37ddb325dc
commit e558e96e6c
2 changed files with 10 additions and 10 deletions

View File

@@ -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)

View File

@@ -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)