diff --git a/entry/src/main/ets/common/Logger.ts b/entry/src/main/ets/common/Logger.ts new file mode 100644 index 0000000000000000000000000000000000000000..de85153458a09d244f68363d1b99fb5e68e0c8f5 --- /dev/null +++ b/entry/src/main/ets/common/Logger.ts @@ -0,0 +1,30 @@ +import hilog from '@ohos.hilog' + +class Logger { + private domain: number + private prefix: string + private format: string = "%{public}s, %{public}s" + + constructor(prefix: string) { + this.prefix = prefix + this.domain = 0xFF00 + } + + debug(...args: any[]) { + hilog.debug(this.domain, this.prefix, this.format, args) + } + + info(...args: any[]) { + hilog.info(this.domain, this.prefix, this.format, args) + } + + warn(...args: any[]) { + hilog.warn(this.domain, this.prefix, this.format, args) + } + + error(...args: any[]) { + hilog.error(this.domain, this.prefix, this.format, args) + } +} + +export default new Logger('[MultiMedia]') \ No newline at end of file