[Pkg-mozext-commits] [tabmixplus] 05/27: Remove CR (carriage return) from messages send to the console

David Prévot taffit at moszumanska.debian.org
Fri Dec 26 01:04:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit a8f3328c14fc8662c03ba3958f6863b43d398ecf
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Nov 2 14:44:28 2014 +0200

    Remove CR (carriage return) from messages send to the console
---
 modules/log.jsm | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/log.jsm b/modules/log.jsm
index 05b8473..3bdf73f 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -82,8 +82,12 @@ let console = {
     } catch (ex) {this.assert(ex, "Error we can't show " + aMethod + " in Tabmix.show");}
   },
 
+  logStringMessage: function(aMessage) {
+    Services.console.logStringMessage(aMessage.replace(/\r\n/g, "\n"));
+  },
+
   clog: function(aMessage) {
-    Services.console.logStringMessage("TabMix :\n" + aMessage);
+    this.logStringMessage("TabMix :\n" + aMessage);
   },
 
   log: function TMP_console_log(aMessage, aShowCaller, offset) {
@@ -91,7 +95,7 @@ let console = {
     let names = this._getNames(aShowCaller ? 2 + offset : 1 + offset);
     let callerName = names[offset+0];
     let callerCallerName = aShowCaller && names[offset+1] ? " (caller was " + names[offset+1] + ")" : "";
-    Services.console.logStringMessage("TabMix " + callerName + callerCallerName + " :\n" + aMessage);
+    this.logStringMessage("TabMix " + callerName + callerCallerName + " :\n" + aMessage);
   },
 
   // get functions names from Error().stack
@@ -273,11 +277,11 @@ options = {
     let location = aError.location ? "\n" + aError.location : "";
     let assertionText = "Tabmix Plus ERROR" + errAt + ":\n" + (aMsg ? aMsg + "\n" : "") + aError.message + location;
     let stackText = "\nStack Trace: \n" + this._formatStack(aError.stack.split("\n"));
-    Services.console.logStringMessage(assertionText + stackText);
+    this.logStringMessage(assertionText + stackText);
   },
 
   trace: function TMP_console_trace(aMsg) {
     let stack = this._formatStack(this._getStackExcludingInternal());
-    Services.console.logStringMessage("Tabmix Trace: " + (aMsg || "") + '\n' + stack);
+    this.logStringMessage("Tabmix Trace: " + (aMsg || "") + '\n' + stack);
   }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list