UNPKG

homebridge-hikvision-local

Version:

Homebridge plugin that connects to your HikVision DVR via a local connection and exposes your cameras in Homebridge. The plugin is heavily based on excellent [homebridge-camera-ffmpeg](https://github.com/Sunoo/homebridge-camera-ffmpeg) and the various hom

44 lines 1.14 kB
export class Log { constructor(logger, debugMode) { this.logger = logger; this.debugMode = debugMode; } stringifyArgs(args) { return args .map(arg => { if (typeof arg === 'string') { return arg; } if (Buffer.isBuffer(arg)) { return arg.toString('utf8'); } if (typeof arg === 'object') { return JSON.stringify(arg, null, 2); } return String(arg); }) .join(' '); } debug(...args) { const message = this.stringifyArgs(args); if (this.debugMode) { this.logger.info(message); } else { this.logger.debug(message); } } info(...args) { this.logger.info(this.stringifyArgs(args)); } warn(...args) { this.logger.warn(this.stringifyArgs(args)); } error(...args) { this.logger.error(this.stringifyArgs(args)); } log(...args) { this.logger.info(this.stringifyArgs(args)); } } //# sourceMappingURL=logger.js.map