moved DebugLogView to components folder

This commit is contained in:
Audric Ackermann 2022-04-20 15:50:28 +10:00
parent 3cfcf128a5
commit 335e452730
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
4 changed files with 8 additions and 18 deletions

View File

@ -17,7 +17,7 @@
"util-worker": {
"source": "ts/webworker/workers/util.worker.ts",
"distDir": "./ts/webworker/workers/",
"optimize" : false,
"optimize" : true,
"sourceMap": false,
"context": "web-worker"
}

View File

@ -1,18 +1,6 @@
// /* global $: false */
// /* global Whisper: false */
import React from 'react';
import { DebugLogView } from '../views/DebugLogView';
import { DebugLogView } from '../components/DebugLogView';
// $(document).on('keyup', e => {
// 'use strict';
// if (e.keyCode === 27) {
// window.closeDebugLog();
// }
// });
// Whisper ?
global.setTimeout(() => {
window.ReactDOM.render(<DebugLogView />, document.getElementById('root'));
}, 1000);

View File

@ -66,13 +66,15 @@ export function stubWindow<K extends keyof Window>(fn: K, value: WindowValue<K>)
};
}
const enableLogRedirect = false;
export const stubWindowLog = () => {
stubWindow('log', {
// tslint:disable: no-void-expression
// tslint:disable: no-console
info: (args: any) => console.info(args),
warn: (args: any) => console.warn(args),
error: (args: any) => console.error(args),
debug: (args: any) => console.debug(args),
info: (args: any) => (enableLogRedirect ? console.info(args) : {}),
warn: (args: any) => (enableLogRedirect ? console.warn(args) : {}),
error: (args: any) => (enableLogRedirect ? console.error(args) : {}),
debug: (args: any) => (enableLogRedirect ? console.debug(args) : {}),
});
};