日志
This commit is contained in:
31
uni_modules/yk-log/readme.md
Normal file
31
uni_modules/yk-log/readme.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# yk-log
|
||||
目前官方的`TextEncoder`提示不支持,自己写的字符转byteArray方法后面会导致生成的字节数组末尾出现额外的零字节(0),所以日志换行之后会有乱码。
|
||||
|
||||
由于手机坏了只有备用机,目前测试Android 10及以下的版本可以,10以上理论上也可以。
|
||||
|
||||
日志文件存储在 /storage/emulated/0/Android/data/包名/files/Logs 目录中
|
||||
|
||||
### 方法
|
||||
|
||||
| 方法名 | 说明 | 参数 |
|
||||
| ------ | -------------------------------------------- | ---- |
|
||||
| write | 写入日志,yyyy-MM-dd HH:mm:ss.SSS-[传入消息] | text |
|
||||
|
||||
### 使用示例
|
||||
|
||||
```js
|
||||
import { write } from '../../uni_modules/yk-log'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
wirteLog() {
|
||||
write("1111")
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user