Appearance
接收SDK日志输出
注册日志接口,用于接收SDK日志信息,排查问题。
注意
如果要输出日志到文件或者上传,注意不要包含debug和info级别日志,避免日志量过大,影响应用性能
方法名
addLogListener
用法
- 用法如下:js
module.addLogListener({ //成功返回函数 success: (res) => { console.log(res); }, //失败返回函数 fail: (res) => { console.log(res) }, //接口调用完成返回函数,不管成功还是失败都会返回 complete: (res) => { console.log(res) } })jsmodule.addLogListener({ //成功执行的函数 success: (res) => { console.log(res) }, //失败执行的函数 fail: (res) => { console.log(res) }, //接口调用完成返回函数,不管成功还是失败都会返回 // complete: (res) => { // console.log(res) // } } as LevenOptions) - 参数说明
参数名 参数类型 是否必填 默认值 参数描述 success Function 否 无 执行成功的函数 fail Function 否 无 执行失败的函数 complete Function 否 无 执行完成的函数,不管成功还是失败都会执行
回调
- 示例json
{ "data": { "type":"onLogReceive", "logType":"d", "tag":"", "msg":"", "throwable":"", "flag":"" }, "message": "", "code": 0 } - 回调说明:
参数名 参数类型 参数描述 message String 消息提示 data Object 数据对象 data.type String 类型 onSuccess:设置成功onLogReceive:收到日志消息data.logType String 日志类型 d:debug消息日志i:info消息日志w:warning消息日志e:error消息日志data.tag String 标签 data.msg String 消息 data.throwable String 异常信息 data.flag Integer 标识 code Integer 返回类型,0.成功,其他:失败

