Files
tv-pro/uni_modules/yk-log/readme.md
2025-11-10 14:30:23 +08:00

32 lines
841 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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")
}
}
}
```