diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 44b7d681c..0adf312c3 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -634,45 +634,6 @@ const Inspector = new Lang.Class({ Signals.addSignalMethods(Inspector.prototype); -const ErrorLog = new Lang.Class({ - Name: 'ErrorLog', - - _init: function() { - this.actor = new St.BoxLayout(); - this.text = new St.Label(); - this.actor.add(this.text); - // We need to override StLabel's default ellipsization when - // using line_wrap; otherwise ClutterText's layout is going - // to constrain both the width and height, which prevents - // scrolling. - this.text.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; - this.text.clutter_text.line_wrap = true; - this.actor.connect('notify::mapped', Lang.bind(this, this._renderText)); - }, - - _formatTime: function(d){ - function pad(n) { return n < 10 ? '0' + n : n; } - return d.getUTCFullYear()+'-' - + pad(d.getUTCMonth()+1)+'-' - + pad(d.getUTCDate())+'T' - + pad(d.getUTCHours())+':' - + pad(d.getUTCMinutes())+':' - + pad(d.getUTCSeconds())+'Z'; - }, - - _renderText: function() { - if (!this.actor.mapped) - return; - let text = this.text.text; - let stack = Main._getAndClearErrorStack(); - for (let i = 0; i < stack.length; i++) { - let logItem = stack[i]; - text += logItem.category + ' t=' + this._formatTime(new Date(logItem.timestamp)) + ' ' + logItem.message + '\n'; - } - this.text.text = text; - } -}); - const Memory = new Lang.Class({ Name: 'Memory', @@ -947,9 +908,6 @@ const LookingGlass = new Lang.Class({ })); notebook.appendPage('Windows', this._windowList.actor); - this._errorLog = new ErrorLog(); - notebook.appendPage('Errors', this._errorLog.actor); - this._memory = new Memory(); notebook.appendPage('Memory', this._memory.actor); diff --git a/js/ui/main.js b/js/ui/main.js index 523dabf0c..3b8029756 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -67,7 +67,6 @@ let statusIconDispatcher = null; let keyboard = null; let layoutManager = null; let networkAgent = null; -let _errorLogStack = []; let _startDate; let _defaultCssStylesheet = null; let _cssStylesheet = null; @@ -153,11 +152,9 @@ function _initUserSession() { } function start() { - // Monkey patch utility functions into the global proxy; - // This is easier and faster than indirecting down into global - // if we want to call back up into JS. - global.logError = _logError; - global.log = _logDebug; + // These are here so we don't break compatibility. + global.logError = window.log; + global.log = window.log; // Chain up async errors reported from C global.connect('notify-error', function (global, msg, detail) { notifyError(msg, detail); }); @@ -254,7 +251,6 @@ function start() { global.stage.connect('captured-event', _globalKeyPressHandler); - _log('info', 'loaded at ' + _startDate); log('GNOME Shell started at ' + _startDate); let perfModuleName = GLib.getenv("SHELL_PERF_MODULE"); @@ -540,59 +536,6 @@ function notifyError(msg, details) { notify(msg, details); } -/** - * _log: - * @category: string message type ('info', 'error') - * @msg: A message string - * ...: Any further arguments are converted into JSON notation, - * and appended to the log message, separated by spaces. - * - * Log a message into the LookingGlass error - * stream. This is primarily intended for use by the - * extension system as well as debugging. - */ -function _log(category, msg) { - let text = msg; - if (arguments.length > 2) { - text += ': '; - for (let i = 2; i < arguments.length; i++) { - text += JSON.stringify(arguments[i]); - if (i < arguments.length - 1) - text += ' '; - } - } - _errorLogStack.push({timestamp: new Date().getTime(), - category: category, - message: text }); -} - -function _logError(msg) { - return _log('error', msg); -} - -function _logDebug(msg) { - return _log('debug', msg); -} - -// Used by the error display in lookingGlass.js -function _getAndClearErrorStack() { - let errors = _errorLogStack; - _errorLogStack = []; - return errors; -} - -function logStackTrace(msg) { - try { - throw new Error(); - } catch (e) { - // e.stack must have at least two lines, with the first being - // logStackTrace() (which we strip off), and the second being - // our caller. - let trace = e.stack.substr(e.stack.indexOf('\n') + 1); - log(msg ? (msg + '\n' + trace) : trace); - } -} - function isWindowActorDisplayedOnWorkspace(win, workspaceIndex) { return win.get_workspace() == workspaceIndex || (win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());