# logToApp
控制台打印日志
# 调用方式
logToApp(msg = '', level = 'Error')
1
返回 Promise,使用 then/catch 或 await 处理结果。
# 请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| msg | String | N | '' | 写入 App 本地日志的文本 |
| level | String | N | 'Error' | 日志级别,原样传给宿主 |
# 接口调用示例
this.$bridge.logToApp('请求失败', 'Error')
.then(res => {
console.log(res)
})
.catch(error => {
console.error(error)
})
1
2
3
4
5
6
7
2
3
4
5
6
7
# 返回参数
返回 Promise;原生返回数据的字段由宿主决定,当前 JS 封装未限定完整结构。