From 751df50b8d656c8b0141a17af2c70d921d5c4690 Mon Sep 17 00:00:00 2001 From: Felix Guo Date: Mon, 13 May 2019 20:16:08 -0700 Subject: [PATCH] mercurywm: overwrite default console with our own (#62) Part of #10 --- src/background/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/background/index.js b/src/background/index.js index c0c71d7..a0eb7e3 100644 --- a/src/background/index.js +++ b/src/background/index.js @@ -13,6 +13,25 @@ window.reset = () => { chrome.runtime.reload(); }; +var _console = (function(nativeConsole) { + return { + log: function (text){ + nativeConsole.log(text); + }, + info: function (text) { + nativeConsole.info(text); + }, + warn: function (text) { + nativeConsole.warn(text); + }, + error: function (text) { + nativeConsole.error(text); + }, + assert: nativeConsole.assert + }; +}(window.console)); +console = _console; + console.log('MercuryWM background running'); chrome.runtime.onConnect.addListener(port => {