Skip to content

Commit

Permalink
mercurywm: overwrite default console with our own (#62)
Browse files Browse the repository at this point in the history
Part of #10
  • Loading branch information
fg123 authored and MichaelKim committed May 14, 2019
1 parent 83cf410 commit 751df50
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/background/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 751df50

Please sign in to comment.