diff options
Diffstat (limited to 'editors/code/src/util.ts')
-rw-r--r-- | editors/code/src/util.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts new file mode 100644 index 000000000..7a6657753 --- /dev/null +++ b/editors/code/src/util.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | let enabled: boolean = false; | ||
2 | |||
3 | export const log = { | ||
4 | debug(message?: any, ...optionalParams: any[]): void { | ||
5 | if (!enabled) return; | ||
6 | // eslint-disable-next-line no-console | ||
7 | console.log(message, ...optionalParams); | ||
8 | }, | ||
9 | error(message?: any, ...optionalParams: any[]): void { | ||
10 | if (!enabled) return; | ||
11 | debugger; | ||
12 | // eslint-disable-next-line no-console | ||
13 | console.error(message, ...optionalParams); | ||
14 | }, | ||
15 | setEnabled(yes: boolean): void { | ||
16 | enabled = yes; | ||
17 | } | ||
18 | }; | ||