mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-22 23:46:10 +08:00
update pushy reference method (#499)
* update pushy reference method * update
This commit is contained in:
35
harmony/pushy/src/main/ets/Logger.ts
Normal file
35
harmony/pushy/src/main/ets/Logger.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
import hilog from '@ohos.hilog';
|
||||
|
||||
class Logger {
|
||||
private domain: number;
|
||||
private prefix: string;
|
||||
private format: string = '%{public}s,%{public}s';
|
||||
private isDebug: boolean;
|
||||
|
||||
constructor(prefix: string = 'MyApp', domain: number = 0xFF00, isDebug = false) {
|
||||
this.prefix = prefix;
|
||||
this.domain = domain;
|
||||
this.isDebug = isDebug;
|
||||
}
|
||||
|
||||
debug(...args: string[]): void {
|
||||
if (this.isDebug) {
|
||||
hilog.debug(this.domain, this.prefix, this.format, args);
|
||||
}
|
||||
}
|
||||
|
||||
info(...args: string[]): void {
|
||||
hilog.info(this.domain, this.prefix, this.format, args);
|
||||
}
|
||||
|
||||
warn(...args: string[]): void {
|
||||
hilog.warn(this.domain, this.prefix, this.format, args);
|
||||
}
|
||||
|
||||
error(...args: string[]): void {
|
||||
hilog.error(this.domain, this.prefix, this.format, args);
|
||||
}
|
||||
}
|
||||
|
||||
export default new Logger('geolocation', 0xFF00, false)
|
||||
Reference in New Issue
Block a user