Bug 975944 - fix log appenders' ._name property. r=unfocused
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 25 Feb 2014 09:31:41 +1100
changeset 170838 3e84bd445574ff1a624b15f832d4c49883996f72
parent 170837 76b34c6338f4c39b70f00fc62a39691d0808d112
child 170839 6a8b0834c5fc4c85ecf268af43a2a11200acced5
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersunfocused
bugs975944
milestone30.0a1
Bug 975944 - fix log appenders' ._name property. r=unfocused
toolkit/modules/Log.jsm
--- a/toolkit/modules/Log.jsm
+++ b/toolkit/modules/Log.jsm
@@ -452,35 +452,35 @@ Appender.prototype = {
 };
 
 /*
  * DumpAppender
  * Logs to standard out
  */
 
 function DumpAppender(formatter) {
+  Appender.call(this, formatter);
   this._name = "DumpAppender";
-  Appender.call(this, formatter);
 }
 DumpAppender.prototype = {
   __proto__: Appender.prototype,
 
   doAppend: function DApp_doAppend(message) {
     dump(message);
   }
 };
 
 /*
  * ConsoleAppender
  * Logs to the javascript console
  */
 
 function ConsoleAppender(formatter) {
+  Appender.call(this, formatter);
   this._name = "ConsoleAppender";
-  Appender.call(this, formatter);
 }
 ConsoleAppender.prototype = {
   __proto__: Appender.prototype,
 
   doAppend: function CApp_doAppend(message) {
     if (message.level > Log.Level.Warn) {
       Cu.reportError(message);
       return;
@@ -494,18 +494,18 @@ ConsoleAppender.prototype = {
  * Append to an nsIStorageStream
  *
  * This writes logging output to an in-memory stream which can later be read
  * back as an nsIInputStream. It can be used to avoid expensive I/O operations
  * during logging. Instead, one can periodically consume the input stream and
  * e.g. write it to disk asynchronously.
  */
 function StorageStreamAppender(formatter) {
+  Appender.call(this, formatter);
   this._name = "StorageStreamAppender";
-  Appender.call(this, formatter);
 }
 
 StorageStreamAppender.prototype = {
   __proto__: Appender.prototype,
 
   _converterStream: null, // holds the nsIConverterOutputStream
   _outputStream: null,    // holds the underlying nsIOutputStream
 
@@ -576,25 +576,25 @@ StorageStreamAppender.prototype = {
 };
 
 /**
  * File appender
  *
  * Writes output to file using OS.File.
  */
 function FileAppender(path, formatter) {
+  Appender.call(this, formatter);
   this._name = "FileAppender";
   this._encoder = new TextEncoder();
   this._path = path;
   this._file = null;
   this._fileReadyPromise = null;
 
   // This is a promise exposed for testing/debugging the logger itself.
   this._lastWritePromise = null;
-  Appender.call(this, formatter);
 }
 
 FileAppender.prototype = {
   __proto__: Appender.prototype,
 
   _openFile: function () {
     return Task.spawn(function _openFile() {
       try {
@@ -649,21 +649,21 @@ FileAppender.prototype = {
 /**
  * Bounded File appender
  *
  * Writes output to file using OS.File. After the total message size
  * (as defined by message.length) exceeds maxSize, existing messages
  * will be discarded, and subsequent writes will be appended to a new log file.
  */
 function BoundedFileAppender(path, formatter, maxSize=2*ONE_MEGABYTE) {
+  FileAppender.call(this, path, formatter);
   this._name = "BoundedFileAppender";
   this._size = 0;
   this._maxSize = maxSize;
   this._closeFilePromise = null;
-  FileAppender.call(this, path, formatter);
 }
 
 BoundedFileAppender.prototype = {
   __proto__: FileAppender.prototype,
 
   doAppend: function (message) {
     if (!this._removeFilePromise) {
       if (this._size < this._maxSize) {