UNPKG

@hashgraph/hedera-wallet-connect

Version:

A library to facilitate integrating Hedera with WalletConnect

33 lines (32 loc) 905 B
export class DefaultLogger { constructor(logLevel = 'info') { this.logLevel = 'info'; this.logLevel = logLevel; } setLogLevel(level) { this.logLevel = level; } getLogLevel() { return this.logLevel; } error(message, ...args) { if (['error', 'warn', 'info', 'debug'].includes(this.logLevel)) { console.error(`[ERROR] ${message}`, ...args); } } warn(message, ...args) { if (['warn', 'info', 'debug'].includes(this.logLevel)) { console.warn(`[WARN] ${message}`, ...args); } } info(message, ...args) { if (['info', 'debug'].includes(this.logLevel)) { console.info(`[INFO] ${message}`, ...args); } } debug(message, ...args) { if (this.logLevel === 'debug') { console.debug(`[DEBUG] ${message}`, ...args); } } }