added two apps, and better implementation

This commit is contained in:
David Meincke
2022-03-22 18:20:26 +01:00
parent bb44e0e92d
commit 33b3f2e5cc
47 changed files with 486 additions and 151 deletions
+28
View File
@@ -0,0 +1,28 @@
import { NotificationBubbles } from "../../codeeditor-app/elements/notification-bubbles/notification-bubbles";
export function watchConsole(fn: (type: 'log' | 'info' | 'warn' | 'error', value: any) => void) {
// define a new console
var console: any = (function (oldCons) {
return {
log: function (text: any) {
oldCons.log(text);
fn('log', text);
},
info: function (text: any) {
oldCons.info(text);
fn('info', text);
},
warn: function (text: any) {
oldCons.warn(text);
fn('warn', text);
},
error: function (text: any) {
oldCons.error(text);
fn('error', text);
}
};
}(window.console));
//Then redefine the old console
window.console = console;
}