1 |
|
2 |
|
3 |
|
4 | let debugLogImpl = (s: string) => {};
|
5 |
|
6 | export function debugLog(s: string) {
|
7 | debugLogImpl(s);
|
8 | }
|
9 |
|
10 | export function setDebugLog(logFn: (s: string) => void) {
|
11 | debugLogImpl = logFn;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 | let showWarnings = true;
|
17 |
|
18 | export function suppressWarnings() {
|
19 | showWarnings = false;
|
20 | }
|
21 |
|
22 | export function shouldShowWarnings(): boolean {
|
23 | return showWarnings;
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | function warnOrLog() {
|
30 |
|
31 | (console.warn || console.log).apply(console, arguments);
|
32 | }
|
33 |
|
34 | export const warn = warnOrLog.bind("[clipboard-polyfill]");
|