homebridge-config-ui-x
Version:
A web based management, configuration and control platform for Homebridge
34 lines • 989 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const color = require("bash-color");
class Logger {
constructor() {
this.pluginName = (process.env.UIX_PLUGIN_NAME || 'homebridge-config-ui-x');
this.useTimestamps = (process.env.UIX_LOG_NO_TIMESTAMPS !== '1');
}
get prefix() {
if (this.useTimestamps) {
return color.white(`[${new Date().toLocaleString()}] `) + color.cyan(`[${this.pluginName}]`);
}
else {
return color.cyan(`[${this.pluginName}]`);
}
}
log(args) {
console.log(this.prefix, args);
}
error(args) {
console.error(this.prefix, color.red(args));
}
warn(args) {
console.warn(this.prefix, color.yellow(args));
}
debug(args) {
console.debug(this.prefix, args);
}
verbose(args) {
console.debug(this.prefix, args);
}
}
exports.Logger = Logger;
//# sourceMappingURL=logger.service.js.map