HarmonyOS鸿蒙Next中安装日志插件
HarmonyOS鸿蒙Next中安装日志插件 OpenHarmony三方库中心仓
ohpm install [@abner](/user/abner)/log
配置插件文件 product/phone/src/main/ets/utils/plugin.ets
import { Log } from '[@abner](/user/abner)/log'
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn'
// 设置语言为中文
dayjs.locale('zh-cn');
Log.init({
tag: "yk-yl",//自定义
domain: 0xEC00,
close: false,
isHilog: true,
showLogLocation: true,
logSize: 200
})
使用插件
import "../utils/plugin"
import { Log } from '[@abner](/user/abner)/log';
更多关于HarmonyOS鸿蒙Next中安装日志插件的实战教程也可以访问 https://www.itying.com/category-93-b0.html