UNPKG

@antv/s2

Version:

effective spreadsheet render core lib

35 lines 1.03 kB
/* eslint-disable no-console */ export const DEBUG_TRANSFORM_DATA = 'Transform Data'; export const DEBUG_HEADER_LAYOUT = 'Header Layout'; export const DEBUG_VIEW_RENDER = 'Data Cell Render'; export 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; } } //# sourceMappingURL=index.js.map