diff --git a/services/web/frontend/js/base.js b/services/web/frontend/js/base.js index 346ece296c..657d7d46d0 100644 --- a/services/web/frontend/js/base.js +++ b/services/web/frontend/js/base.js @@ -85,26 +85,9 @@ App.run(($rootScope, $templateCache) => { ) }) -const sl_debugging = - __guard__(window.location != null ? window.location.search : undefined, x => - x.match(/debug=true/) - ) != null -var sl_console_last_log = null +const sl_debugging = window.location.search.match(/debug=true/) window.sl_debugging = sl_debugging // make a global flag for debugging code -window.sl_console = { - log(...args) { - if (sl_debugging) { - sl_console_last_log = null - return console.log(...Array.from(args || [])) - } - }, - logOnce(...args) { - if (sl_debugging && args[0] !== sl_console_last_log) { - sl_console_last_log = args[0] - return console.log(...Array.from(args || [])) - } - } -} +window.sl_console = sl_debugging ? console : { log() {} } export default App diff --git a/services/web/frontend/js/ide/editor/Document.js b/services/web/frontend/js/ide/editor/Document.js index ce0f89fe07..053c6ab57e 100644 --- a/services/web/frontend/js/ide/editor/Document.js +++ b/services/web/frontend/js/ide/editor/Document.js @@ -328,7 +328,7 @@ export default (Document = (function() { if (inflightOp == null && pendingOp == null) { // there's nothing going on, this is ok. saved = true - sl_console.logOnce('[pollSavedStatus] no inflight or pending ops') + sl_console.log('[pollSavedStatus] no inflight or pending ops') } else if (inflightOp != null && inflightOp === this.oldInflightOp) { // The same inflight op has been sitting unacked since we // last checked, this is bad.