封装Logger

73 阅读1分钟
import { hilog } from '@kit.PerformanceAnalysisKit'

const domain =0x0000
const tag = 'myLog'
const format = '%{public}s %{public}s'

export class Logger{

  static info(...args:string[]){
    hilog.info(domain,tag,format,...args)
  }

  static debug(...args:string[]){
    hilog.debug(domain,tag,format,...args)
  }

  static warn(...args:string[]){
    hilog.warn(domain,tag,format,...args)
  }

  static error(...args:string[]){
    hilog.error(domain,tag,format,...args)
  }
}