diff --git a/toolkit/components/console/hudservice/HUDService.jsm b/toolkit/components/console/hudservice/HUDService.jsm index eff7ab99984..362e88fce99 100644 --- a/toolkit/components/console/hudservice/HUDService.jsm +++ b/toolkit/components/console/hudservice/HUDService.jsm @@ -1988,34 +1988,29 @@ function HUDConsole(aHeadsUpDisplay) HUDConsole.prototype = { created: null, - log: function console_log(aMessage) + log: function console_log() { - this.message = aMessage; - this.sendToHUDService("log"); + this.sendToHUDService("log", arguments); }, - info: function console_info(aMessage) + info: function console_info() { - this.message = aMessage; - this.sendToHUDService("info"); + this.sendToHUDService("info", arguments); }, - warn: function console_warn(aMessage) + warn: function console_warn() { - this.message = aMessage; - this.sendToHUDService("warn"); + this.sendToHUDService("warn", arguments); }, - error: function console_error(aMessage) + error: function console_error() { - this.message = aMessage; - this.sendToHUDService("error"); + this.sendToHUDService("error", arguments); }, - exception: function console_exception(aMessage) + exception: function console_exception() { - this.message = aMessage; - this.sendToHUDService("exception"); + this.sendToHUDService("exception", arguments); }, timeStamp: function Console_timeStamp() @@ -2023,7 +2018,7 @@ HUDConsole.prototype = { return ConsoleUtils.timeStamp(new Date()); }, - sendToHUDService: function console_send(aLevel) + sendToHUDService: function console_send(aLevel, aArguments) { // check to see if logging is on for this level before logging! var filterState = HUDService.getFilterState(this.hudId, aLevel); @@ -2041,8 +2036,13 @@ HUDConsole.prototype = { messageNode.setAttribute("class", klass); + let argsArray = []; + for (var i = 0; i < aArguments.length; i++) { + argsArray.push(aArguments[i]); + } + let timestampedMessage = - this.chromeDocument.createTextNode(ts + ": " + this.message); + this.chromeDocument.createTextNode(ts + ": " + argsArray.join(" ")); messageNode.appendChild(timestampedMessage); // need a constructor here to properly set all attrs diff --git a/toolkit/components/console/hudservice/tests/browser/browser_HUDServiceTestsAll.js b/toolkit/components/console/hudservice/tests/browser/browser_HUDServiceTestsAll.js index e85f5eaeb09..0546b31aac1 100644 --- a/toolkit/components/console/hudservice/tests/browser/browser_HUDServiceTestsAll.js +++ b/toolkit/components/console/hudservice/tests/browser/browser_HUDServiceTestsAll.js @@ -226,6 +226,17 @@ function testConsoleLoggingAPI(aMethod) ok(count == 0, aMethod + " logging tunred off, 0 messages logged"); HUDService.clearDisplay(hudId); filterBox.value = ""; + + // test for multiple arguments. + HUDService.clearDisplay(hudId); + HUDService.setFilterState(hudId, aMethod, true); + browser.contentWindow.wrappedJSObject.console[aMethod]("foo", "bar"); + + let HUD = HUDService.hudWeakReferences[hudId].get(); + let jsterm = HUD.jsterm; + let outputLogNode = jsterm.outputNode; + ok(/foo bar/.test(outputLogNode.childNodes[0].childNodes[0].nodeValue), + "Emitted both console arguments"); } function testLogEntry(aOutputNode, aMatchString, aSuccessErrObj) diff --git a/toolkit/themes/pinstripe/global/headsUpDisplay.css b/toolkit/themes/pinstripe/global/headsUpDisplay.css index b415dda96a5..abc85a6d42c 100644 --- a/toolkit/themes/pinstripe/global/headsUpDisplay.css +++ b/toolkit/themes/pinstripe/global/headsUpDisplay.css @@ -57,6 +57,7 @@ .hud-output-node div { -moz-user-select: text; + white-space: pre-wrap; } .hud-output-node .hud-network { diff --git a/toolkit/themes/winstripe/global/headsUpDisplay.css b/toolkit/themes/winstripe/global/headsUpDisplay.css index f8a463da2da..ffe082e7549 100644 --- a/toolkit/themes/winstripe/global/headsUpDisplay.css +++ b/toolkit/themes/winstripe/global/headsUpDisplay.css @@ -57,6 +57,7 @@ .hud-output-node div { -moz-user-select: text; + white-space: pre-wrap; } .hud-output-node .hud-network {