feat(common): 新增基础设施 HAR(网络/鉴权/日志/状态/工具)

This commit is contained in:
AndyChen1024
2026-09-11 16:22:45 +08:00
parent 2dc02b44c7
commit b73e74fa4a
16 changed files with 307 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { hilog } from '@kit.PerformanceAnalysisKit';
const APP_DOMAIN: number = 0x0000;
/**
* 日志封装:统一 DOMAIN 与等级,后续可在此加开关/上报。
*/
export class Logger {
static debug(tag: string, message: string): void {
hilog.debug(APP_DOMAIN, tag, '%{public}s', message);
}
static info(tag: string, message: string): void {
hilog.info(APP_DOMAIN, tag, '%{public}s', message);
}
static warn(tag: string, message: string): void {
hilog.warn(APP_DOMAIN, tag, '%{public}s', message);
}
static error(tag: string, message: string): void {
hilog.error(APP_DOMAIN, tag, '%{public}s', message);
}
}