feat(common): 新增基础设施 HAR(网络/鉴权/日志/状态/工具)
This commit is contained in:
24
common/src/main/ets/logging/Logger.ets
Normal file
24
common/src/main/ets/logging/Logger.ets
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user