@glodon-aiot/agent-cli-sdk
Version:
aiot agent client js sdk
32 lines (31 loc) • 793 B
JavaScript
var n = Object.defineProperty;
var f = (s, e, i) => e in s ? n(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i;
var r = (s, e, i) => (f(s, typeof e != "symbol" ? e + "" : e, i), i);
const o = class o {
constructor(e, i = !1) {
this.prefix = e, this.open = i;
}
disable() {
this.open = !1;
}
enable() {
this.open = !0;
}
log(...e) {
!this.open && !o.debug || console.log(this.prefix, ...e);
}
info(...e) {
!this.open && !o.debug || console.info(`%c ${this.prefix} %o`, "color:#0f0;", ...e);
}
error(...e) {
!this.open && !o.debug || console.error(this.prefix, ...e);
}
warn(...e) {
!this.open && !o.debug || console.warn(this.prefix, ...e);
}
};
r(o, "debug", !1);
let t = o;
export {
t as default
};