@antv/s2
Version:
effective spreadsheet render core lib
39 lines • 1.24 kB
JavaScript
;
/* eslint-disable no-console */
Object.defineProperty(exports, "__esModule", { value: true });
exports.DebuggerUtil = exports.DEBUG_VIEW_RENDER = exports.DEBUG_HEADER_LAYOUT = exports.DEBUG_TRANSFORM_DATA = void 0;
exports.DEBUG_TRANSFORM_DATA = 'Transform Data';
exports.DEBUG_HEADER_LAYOUT = 'Header Layout';
exports.DEBUG_VIEW_RENDER = 'Data Cell Render';
class DebuggerUtil {
constructor() {
this.debug = false;
this.debugCallback = (info, callback) => {
if (this.debug) {
const start = performance.now();
callback();
const end = performance.now();
console.log(info, `${end - start} ms`);
}
else {
callback();
}
};
this.logger = (info, ...params) => {
if (this.debug) {
console.log(info, ...params);
}
};
}
static getInstance() {
if (!DebuggerUtil.instance) {
DebuggerUtil.instance = new DebuggerUtil();
}
return DebuggerUtil.instance;
}
setDebug(debug) {
this.debug = debug;
}
}
exports.DebuggerUtil = DebuggerUtil;
//# sourceMappingURL=index.js.map