mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-01 03:26:51 +00:00
23 lines
357 B
TypeScript
23 lines
357 B
TypeScript
import { debug } from 'debug'
|
|
export class NcDebug {
|
|
private static logger: any
|
|
|
|
static initLogger() {
|
|
if (!NcDebug.logger) {
|
|
NcDebug.logger = debug('nc')
|
|
}
|
|
|
|
return NcDebug.logger
|
|
}
|
|
|
|
static log(...args: any[]) {
|
|
if (!debug.enabled('nc')) {
|
|
return
|
|
}
|
|
|
|
const logger = NcDebug.initLogger()
|
|
|
|
logger(...args)
|
|
}
|
|
}
|