Changeset 740

Show
Ignore:
Timestamp:
2008-01-13 02:37:20 (1 year ago)
Author:
MaierMan
Message:

dtaIDebugService interface + implementation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/chrome/content/common/internalFunctions.js

    r719 r740  
    8484         
    8585        if (typeof(data) == 'object') { 
    86                 return data.toSource(); 
     86                try { 
     87                        return data.toSource(); 
     88                } 
     89                catch (ex) { 
     90                        // fall-trough 
     91                } 
    8792        } 
    8893         
     
    106111                } 
    107112                else { 
    108                         Debug.dump("requested a non-existing element: " + id); 
     113                        Debug.logString("requested a non-existing element: " + id); 
    109114                } 
    110115        } 
     
    234239                } 
    235240                catch (ex) { 
    236                         Debug.dump("Utils.askForDir():", ex); 
     241                        Debug.log("Utils.askForDir():", ex); 
    237242                } 
    238243                return false; 
     
    271276                } 
    272277                catch(ex) { 
    273                         Debug.dump('Utils.validateDir()', ex); 
     278                        Debug.log('Utils.validateDir()', ex); 
    274279                } 
    275280                return false; 
     
    302307                } 
    303308                catch(ex) { 
    304                         Debug.dump("Playing " + name + " sound failed", ex); 
     309                        Debug.log("Playing " + name + " sound failed", ex); 
    305310                } 
    306311        }, 
     
    438443        } 
    439444        catch (ex) { 
    440                 Debug.dump("updateIcon: failed to grab icon", ex); 
     445                Debug.log("updateIcon: failed to grab icon", ex); 
    441446        } 
    442447        return "moz-icon://foo.html?size=" + size; 
     
    730735        killAll: function TM_killAll() { 
    731736                for (id in this._timers) { 
    732                         Debug.dump("killing: " + id); 
     737                        Debug.logString("killing: " + id); 
    733738                        window.clearTimeout(this._timers[id]._tid); 
    734739                } 
  • trunk/chrome/content/common/overlayFunctions.js

    r719 r740  
    180180        } 
    181181}; 
    182 var DTA_debug = { 
    183         _dumpEnabled : false, 
    184         _consoleService : null, 
    185         _logPointer : null, 
    186         load : function() { 
    187                 this._dumpEnabled = DTA_preferences.getDTA("logging", false); 
    188                 if (!this._dumpEnabled) { 
    189                         this.dump = this._dumpStub; 
    190                         return; 
    191                 } 
    192                 this.dump = this._dump; 
    193                 this._consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService); 
    194                 this._logPointer = DTA_profileFile.get('dta_log.txt'); 
    195                 try { 
    196                         if (this._logPointer.fileSize > (200 * 1024)) 
    197                                 this._logPointer.remove(false); 
    198                 } catch(e) {} 
    199         }, 
    200         formatTimeDate: function DD_formatTimeDate(value) { 
    201                 return String(value).replace(/\b(\d)\b/g, "0$1"); 
    202         }, 
    203         _dump : function(message, e) { 
    204                 try { 
    205                         if (message == "" && typeof(e) != "object") { 
    206                                 return; 
    207                         } 
    208  
    209                         message = String(message); 
    210  
    211                         var time = new Date(); 
    212                         var text = this.formatTimeDate(time.getHours()) 
    213                                 + ":" + this.formatTimeDate(time.getMinutes()) 
    214                                 + ":" + this.formatTimeDate(time.getSeconds()) 
    215                                 + ":" + time.getMilliseconds() 
    216                                 + "\x0D\x0A\t"; 
    217  
    218                         if (message != "") { 
    219                                 text += message.replace(/\n/g, "\x0D\x0A\t") + " "; 
    220                         } 
    221                         if (e instanceof Components.Exception) { 
    222                                 text += e.toString(); 
    223                         } else if (e instanceof Error) { 
    224                                 if (!e.message) 
    225                                         text += e; 
    226                                 else 
    227                                         text += e.message + " (" + e.fileName +" line " + e.lineNumber + ")"; 
    228                         } 
    229                         else if (e instanceof String || typeof(e) == "string") { 
    230                                 text += e; 
    231                         } 
    232                         else if (e instanceof Number || typeof(e) == "number") { 
    233                                 text += "ResCode: " + e; 
    234                         } 
    235                         else if (e) { 
    236                                 text += e.toSource(); 
    237                         } 
    238                         text += "\x0D\x0A"; 
    239  
    240                         if (Components.stack) { 
    241                                 var stack = Components.stack.caller; 
    242                                 for (var i = 0; i < 4 && stack; ++i) { 
    243                                         text += stack.toString() + "\x0D\x0A"; 
    244                                         stack = stack.caller; 
    245                                 } 
    246                         } 
    247  
    248                         this._consoleService.logStringMessage(text); 
    249  
    250                         var fo = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream); 
    251                         fo.init(this._logPointer, 0x04 | 0x08 | 0x10, 0664, 0); 
    252                         fo.write(text, text.length); 
    253                         fo.close(); 
    254                 } catch(ex) { 
    255                         Components.utils.reportError(ex); 
    256                 } 
    257         }, 
    258         _dumpStub: function() {}, 
    259         dumpObj: function(obj) { 
    260                 for (i in obj) { 
    261                         Components.utils.reportError(i + ": " + (obj[i] ? obj[i].toSource() : obj[i])); 
    262                 } 
    263         } 
    264 }; 
    265 DTA_debug.load(); 
     182var DTA_debug = Components.classes['@downthemall.net/debug-service;1'] 
     183        .getService(Components.interfaces.dtaIDebugService); 
    266184 
    267185var DTA_URLhelpers = { 
     
    279197                        try { 
    280198                                rv = decodeURIComponent(text); 
    281                         } catch (ex) { 
    282                                 DTA_debug.dump("DTA_URLhelpers: failed to decode: " + text, ex); 
     199                        } 
     200                        catch (ex) { 
     201                                DTA_debug.log("DTA_URLhelpers: failed to decode: " + text, ex); 
    283202                        } 
    284203                } 
     
    509428                if (turbo) { 
    510429 
    511                         DTA_debug.dump("saveLinkArray(): DtaOneClick filtering started"); 
     430                        DTA_debug.logString("saveLinkArray(): DtaOneClick filtering started"); 
    512431 
    513432                        var links; 
     
    538457                        ); 
    539458 
    540                         DTA_debug.dump("saveLinkArray(): DtaOneClick has filtered " + links.length + " URLs"); 
     459                        DTA_debug.logString("saveLinkArray(): DtaOneClick has filtered " + links.length + " URLs"); 
    541460 
    542461                        if (links.length == 0) { 
     
    572491                        return DTA_Mediator.getByUrl("chrome://dta/content/dta/manager.xul"); 
    573492                } catch(ex) { 
    574                         DTA_debug.dump("openManager():", ex); 
     493                        DTA_debug.log("openManager():", ex); 
    575494                } 
    576495                return null; 
     
    656575                                ref = DTA_AddingFunctions.ios.newURI(ref, null, null); 
    657576                        } catch (ex) { 
    658                                 DTA_debug.dump(ref, ex); 
     577                                DTA_debug.log(ref, ex); 
    659578                                ref = null; 
    660579                        } 
  • trunk/chrome/content/dta/addurl.js

    r712 r740  
    152152                        } 
    153153                        catch (ex) { 
    154                                 Debug.dump(ex); 
     154                                Debug.log(ex); 
    155155                                this._pats.push(new Literal(m[0])); 
    156156                        } 
     
    175175                        } 
    176176                        catch (ex) { 
    177                                 Debug.dump(ex); 
     177                                Debug.log(ex); 
    178178                                this._pats.push(new Literal(m[0])); 
    179179                        } 
     
    321321                                } 
    322322                                catch (ex) { 
    323                                         Debug.dump("Not able to gather data from the clipboard!"); 
     323                                        Debug.log("Not able to gather data from the clipboard!"); 
    324324                                } 
    325325                        } 
     
    329329                         
    330330                        window.sizeToContent(); 
    331                 } catch(ex) { 
    332                         Debug.dump("load():", ex); 
     331                } 
     332                catch(ex) { 
     333                        Debug.log("load():", ex); 
    333334                }                
    334335        }, 
  • trunk/chrome/content/dta/manager.js

    r736 r740  
    112112                                } 
    113113                                catch (ex) { 
    114                                         Debug.dump("cannot set cancelQuit", ex); 
    115                                         // 
     114                                        Debug.log("cannot set cancelQuit", ex); 
    116115                                } 
    117116                        } 
     
    204203                } 
    205204                catch(ex) { 
    206                         Debug.dump("refresh():", ex); 
     205                        Debug.log("refresh():", ex); 
    207206                } 
    208207        }, 
     
    243242                                                        d.cancel(_("timeout")); 
    244243                                                } 
    245                                                 Debug.dump(d + " is a timeout"); 
     244                                                Debug.logString(d + " is a timeout"); 
    246245                                        } 
    247246                                } 
    248247                        ) 
    249248                        this.startNext(); 
    250                 } catch(ex) { 
    251                         Debug.dump("checkDownloads():", ex); 
     249                } 
     250                catch(ex) { 
     251                        Debug.log("checkDownloads():", ex); 
    252252                } 
    253253        }, 
     
    277277                        } 
    278278                        return rv; 
    279                 } catch(ex){ 
    280                         Debug.dump("startNext():", ex); 
     279                } 
     280                catch(ex){ 
     281                        Debug.log("startNext():", ex); 
    281282                } 
    282283                return false; 
     
    293294                        // but we cannot handle it because we don't know at which stage we crashed 
    294295                        download.partialSize = download.totalSize; 
    295                         Debug.dump("Download seems to be complete; likely a left-over from a crash, finish it:" + download); 
     296                        Debug.logString("Download seems to be complete; likely a left-over from a crash, finish it:" + download); 
    296297                        download.finishDownload(); 
    297298                        return; 
     
    302303                if (!download.started) { 
    303304                        download.started = true; 
    304                         Debug.dump("Let's start " + download); 
     305                        Debug.logString("Let's start " + download); 
    305306                } 
    306307                else { 
    307                         Debug.dump("Let's resume " + download + " at " + download.partialSize); 
     308                        Debug.logString("Let's resume " + download + " at " + download.partialSize); 
    308309                } 
    309310                this._running.push(new Dialog.RunningJob(download)); 
     
    334335                                return; 
    335336                        } 
    336                         Debug.dump("signal(): Queue finished"); 
     337                        Debug.logString("signal(): Queue finished"); 
    337338                        Utils.playSound("done"); 
    338339                         
     
    359360                } 
    360361                catch(ex) { 
    361                         Debug.dump("signal():", ex); 
     362                        Debug.log("signal():", ex); 
    362363                } 
    363364        }, 
     
    450451                        } 
    451452                        else { 
    452                                 Debug.dump("Going down even if queue was not probably closed yet!"); 
     453                                Debug.logString("Going down even if queue was not probably closed yet!"); 
    453454                        } 
    454455                } 
     
    457458                try { 
    458459                        this._cleanTmpDir(); 
    459                 } catch(ex) { 
    460                         Debug.dump("_safeClose", ex); 
     460                } 
     461                catch(ex) { 
     462                        Debug.log("_safeClose", ex); 
    461463                } 
    462464                self.close(); 
     
    607609                                        var ch = aValue.match(/charset=['"]?([\w\d_-]+)/i); 
    608610                                        if (ch && ch[1].length) { 
    609                                                 DTA_debug.dump("visitHeader: found override to " + ch[1]); 
     611                                                DTA_debug.logString("visitHeader: found override to " + ch[1]); 
    610612                                                this.overrideCharset = ch[1]; 
    611613                                        } 
     
    619621                                case 'accept-ranges': 
    620622                                        this.acceptRanges = aValue.toLowerCase().indexOf('none') == -1; 
    621                                         Debug.dump("acceptrange = " + aValue.toLowerCase()); 
     623                                        Debug.logString("acceptrange = " + aValue.toLowerCase()); 
    622624                                break; 
    623625 
     
    638640                                        } 
    639641                                        catch (ex) { 
    640                                                 Debug.dump("gts", ex); 
    641                                                 // no-op 
     642                                                Debug.log("gts", ex); 
    642643                                        } 
    643644                                break; 
     
    668669                                } 
    669670                        } 
    670                 } catch (ex) { 
    671                         Debug.dump("hrhv::visitHeader:", ex); 
     671                } 
     672                catch (ex) { 
     673                        Debug.log("hrhv::visitHeader:", ex); 
    672674                } 
    673675        }, 
     
    688690                                        continue; 
    689691                                } 
    690                                 Debug.dump(x + " missing"); 
     692                                Debug.logString(x + " missing"); 
    691693                                throw new Exception(x + " is missing"); 
    692694                        } 
    693695                        // header is there, but differs 
    694696                        else if (this[x] != v[x]) { 
    695                                 Debug.dump(x + " nm: [" + this[x] + "] [" + v[x] + "]"); 
     697                                Debug.logString(x + " nm: [" + this[x] + "] [" + v[x] + "]"); 
    696698                                throw new Exception("Header " + x + " doesn't match"); 
    697699                        } 
     
    731733                        try { 
    732734                                this._visitors[nodes[i].url] = new Visitor(nodes[i].values); 
    733                         } catch (ex) { 
    734                                 Debug.dump("failed to read one visitor", ex); 
     735                        } 
     736                        catch (ex) { 
     737                                Debug.log("failed to read one visitor", ex); 
    735738                        } 
    736739                } 
     
    749752                                v.values = this._visitors[x].save(); 
    750753                                rv.push(v); 
    751                         } catch(ex) { 
    752                                 Debug.dump(x, ex); 
     754                        } 
     755                        catch(ex) { 
     756                                Debug.log(x, ex); 
    753757                        } 
    754758                } 
     
    836840                } 
    837841                catch (ex) { 
    838                         Debug.dump("tried to construct with invalid tmpFile", ex); 
     842                        Debug.log("tried to construct with invalid tmpFile", ex); 
    839843                        this.cancel(); 
    840844                } 
     
    10171021                } 
    10181022                this.invalidate(); 
    1019                 Debug.dump("mc set to", nv); 
     1023                Debug.log("mc set to", nv); 
    10201024                return this._maxChunks; 
    10211025        }, 
     
    10411045                } 
    10421046                catch (ex) { 
    1043                         Debug.dump("download::getSize(): ", e) 
     1047                        Debug.log("download::getSize(): ", e) 
    10441048                } 
    10451049                return 0; 
     
    11401144                        this.chunks.forEach(function(c) { c.close(); }); 
    11411145                        var destination = new FileFactory(this.destinationPath); 
    1142                         Debug.dump(this.fileName + ": Move " + this.tmpFile.path + " to " + this.destinationFile); 
     1146                        Debug.logString(this.fileName + ": Move " + this.tmpFile.path + " to " + this.destinationFile); 
    11431147 
    11441148                        if (!destination.exists()) { 
     
    11611165                } 
    11621166                catch(ex) { 
    1163                         Debug.dump(ex); 
     1167                        Debug.log("continueMoveCompleted encountered an error", ex); 
    11641168                        this.complete(ex); 
    11651169                } 
     
    11711175                } 
    11721176                catch (ex) { 
    1173                         Debug.dump("handleMetalink", ex); 
     1177                        Debug.log("handleMetalink", ex); 
    11741178                } 
    11751179        }, 
     
    12011205                        } 
    12021206                        catch (ex) { 
    1203                                 Debug.dump("Setting timestamp on file failed: ", ex); 
     1207                                Debug.log("Setting timestamp on file failed: ", ex); 
    12041208                        } 
    12051209                } 
     
    12101214        }, 
    12111215        finishDownload: function QI_finishDownload(exception) { 
    1212                 Debug.dump("finishDownload, connections", this.sessionConnections); 
     1216                Debug.logString("finishDownload, connections: " + this.sessionConnections); 
    12131217                this._completeEvents = ['moveCompleted', 'setAttributes']; 
    12141218                if (this.hash) { 
     
    12271231                if (exception) { 
    12281232                        this.fail(_("accesserror"), _("permissions") + " " + _("destpath") + ". " + _("checkperm"), _("accesserror")); 
    1229                         Debug.dump("complete: ", exception); 
     1233                        Debug.log("complete: ", exception); 
    12301234                        return; 
    12311235                } 
     
    12391243                                        } 
    12401244                                        catch(ex) { 
    1241                                                 Debug.dump("completeEvent failed: " + evt, ex); 
     1245                                                Debug.log("completeEvent failed: " + evt, ex); 
    12421246                                                tp.complete(); 
    12431247                                        } 
     
    13421346                        this._destinationName = this.fileName; 
    13431347                        this._destinationPath = this.pathName.addFinalSlash(); 
    1344                         Debug.dump("rebuildDestination():", ex); 
     1348                        Debug.log("rebuildDestination():", ex); 
    13451349                } 
    13461350                this._destinationNameFull = Utils.formatConflictName( 
     
    13551359 
    13561360        fail: function QI_fail(title, msg, state) { 
    1357                 Debug.dump("failDownload invoked"); 
     1361                Debug.logString("failDownload invoked"); 
    13581362 
    13591363                this.cancel(state); 
     
    13831387                        } 
    13841388                        this.state = CANCELED;                   
    1385                         Debug.dump(this.fileName + ": canceled"); 
     1389                        Debug.logString(this.fileName + ": canceled"); 
    13861390 
    13871391                        this.visitors = new VisitorManager(); 
     
    14031407 
    14041408                } catch(ex) { 
    1405                         Debug.dump("cancel():", ex); 
     1409                        Debug.log("cancel():", ex); 
    14061410                } 
    14071411        }, 
    14081412         
    14091413        removeTmpFile: function QI_removeTmpFile() { 
    1410                 Debug.dump("remove tmpfile"); 
    14111414                if (this.tmpFile.exists()) { 
    14121415                        try { 
     
    14141417                        } 
    14151418                        catch (ex) { 
    1416                                 Debug.dump("failed to remove tmpfile: " + this.tmpFile.path, ex); 
     1419                                Debug.log("failed to remove tmpfile: " + this.tmpFile.path, ex); 
    14171420                        } 
    14181421                } 
    14191422                else { 
    1420                         Debug.dump("tmpfile not found: " + this.tmpFile.path); 
     1423                        Debug.logString("tmpfile not found: " + this.tmpFile.path); 
    14211424                } 
    14221425        }, 
    14231426        sessionConnections: 0, 
    14241427        resumeDownload: function QI_resumeDownload() { 
    1425                 Debug.dump("resumeDownload"); 
     1428                Debug.logString("resumeDownload: " + d); 
    14261429                function cleanChunks(d) { 
    14271430                        // merge finished chunks together, so that the scoreboard does not bloat that much 
     
    14441447                        chunk.running = true; 
    14451448                        download.state = RUNNING; 
    1446                         Debug.dump("started: " + chunk); 
     1449                        Debug.logString("started: " + chunk); 
    14471450                        chunk.download = new Connection(download, chunk, header); 
    14481451                        ++download.activeChunks; 
     
    15061509                } 
    15071510                catch(ex) { 
    1508                         Debug.dump("resumeDownload():", ex); 
     1511                        Debug.log("resumeDownload():", ex); 
    15091512                } 
    15101513                return false; 
     
    15211524                        } 
    15221525                ); 
    1523                 Debug.dump("scoreboard\n" + scoreboard); 
     1526                Debug.logString("scoreboard\n" + scoreboard); 
    15241527        },       
    15251528        toString: function() { 
     
    15351538                        'mask', 
    15361539                        'pathName', 
    1537                         'hash', 
    15381540                        'compression', 
    15391541                        'maxChunks', 
     
    15461548                        this 
    15471549                ); 
     1550                if (this.hash) { 
     1551                        e.hash = _atos(this.hash.sum); 
     1552                        e.hashType = _atos(this.hash.type); 
     1553                } 
    15481554                e.state = this.is(COMPLETE, CANCELED, FINISHING) ? this.state : PAUSED; 
    15491555                if (this.destinationNameOverride) { 
     
    17071713                } 
    17081714                catch (ex) { 
    1709                         Debug.dump('write: ' + this.parent.tmpFile.path, ex); 
     1715                        Debug.log('write: ' + this.parent.tmpFile.path, ex); 
    17101716                        throw ex; 
    17111717                } 
     
    18011807                                return; 
    18021808                        } 
    1803                         Debug.dump("cancel"); 
     1809                        Debug.logString("cancel"); 
    18041810                        if (!aReason) { 
    18051811                                aReason = 0x804b0002; // NS_BINDING_ABORTED; 
     
    18071813                        this._chan.cancel(aReason); 
    18081814                        this._closed = true; 
    1809                 } catch (ex) { 
    1810                         Debug.dump("cancel", ex); 
     1815                } 
     1816                catch (ex) { 
     1817                        Debug.log("cancel", ex); 
    18111818                } 
    18121819        }, 
     
    18171824                } 
    18181825                catch (ex) { 
    1819                         Debug.dump("interface not implemented: " + iid, ex); 
     1826                        Debug.log("interface not implemented: " + iid, ex); 
    18201827                        throw ex; 
    18211828                } 
     
    18251832                        return WindowWatcherService.getNewAuthPrompter(null) 
    18261833                                .QueryInterface(Ci.nsIAuthPrompt); 
    1827                 } catch (ex) { 
    1828                         Debug.dump("authPrompter", ex); 
     1834                } 
     1835                catch (ex) { 
     1836                        Debug.log("authPrompter", ex); 
    18291837                        throw ex; 
    18301838                } 
     
    18871895                } 
    18881896                catch (ex) { 
    1889                         Debug.dump('onDataAvailable', ex); 
     1897                        Debug.log('onDataAvailable', ex); 
    18901898                        this.d.fail(_("accesserror"), _("permissions") + " " + _("destpath") + ". " + _("checkperm"), _("accesserror")); 
    18911899                } 
     
    19051913                } 
    19061914 
    1907                 Debug.dump("handleError: problem found; trying to recover"); 
     1915                Debug.logString("handleError: problem found; trying to recover"); 
    19081916 
    19091917                 
    19101918                if (d.urlManager.markBad(this.url)) { 
    1911                         Debug.dump("handleError: fresh urls available, kill this one and use another!"); 
     1919                        Debug.logString("handleError: fresh urls available, kill this one and use another!"); 
    19121920                        return true; 
    19131921                } 
    19141922                 
    1915                 Debug.dump("affected: " + c); 
     1923                Debug.logString("affected: " + c); 
    19161924                 
    19171925                let max = -1, found = -1; 
     
    19241932                } 
    19251933                if (found > -1) { 
    1926                         Debug.dump("handleError: found joinable chunk; recovering suceeded", found); 
     1934                        Debug.logString("handleError: found joinable chunk; recovering suceeded, chunk: " + found); 
    19271935                        d.chunks[found].end = c.end; 
    19281936                        if (--d.maxChunks == 1) { 
     
    19411949                                                // should never ever happen :p 
    19421950                                                d.dumpScoreboard(); 
    1943                                                 Debug.dump("overlapping:\n" + c1 + "\n" + c2); 
     1951                                                Debug.logString("overlapping:\n" + c1 + "\n" + c2); 
    19441952                                                d.fail("Internal error", "Please notify the developers that there were 'overlapping chunks'!", "Internal error (please report)"); 
    19451953                                                return false; 
     
    19741982                if (code >= 400) { 
    19751983                        if (!this.handleError()) { 
    1976                                 Debug.dump("handleError: Cannot recover from problem!", code); 
     1984                                Debug.log("handleError: Cannot recover from problem!", code); 
    19771985                                if ([401, 402, 407, 500, 502, 503, 504].indexOf(code) != -1) { 
    1978                                         Debug.dump("we got temp failure!", code); 
     1986                                        Debug.log("we got temp failure!", code); 
    19791987                                        d.pause(); 
    19801988                                        d.status = code >= 500 ? _('temperror') : _('autherror'); 
     
    19982006                // not partial content altough we are multi-chunk 
    19992007                if (code != 206 && !this.isInfoGetter) { 
    2000                         Debug.dump(d + ": Server returned a " + aChannel.responseStatus + " response instead of 206", this.isInfoGetter); 
    2001                         Debug.dump(c, this.url.url); 
     2008                        Debug.log(d + ": Server returned a " + aChannel.responseStatus + " response instead of 206", this.isInfoGetter); 
     2009                        Debug.log(c, this.url.url); 
    20022010                         
    20032011                        d.resumable = false; 
     
    20062014                                vis = {value: '', visitHeader: function(a,b) { this.value += a + ': ' + b + "\n"; }}; 
    20072015                                aChannel.visitRequestHeaders(vis); 
    2008                                 Debug.dump("Request Headers\n\n" + vis.value); 
     2016                                Debug.logString("Request Headers\n\n" + vis.value); 
    20092017                                vis.value = ''; 
    20102018                                aChannel.visitResponseHeaders(vis); 
    2011                                 Debug.dump("Response Headers\n\n" + vis.value); 
     2019                                Debug.logString("Response Headers\n\n" + vis.value); 
    20122020                                d.cancel(); 
    20132021                                d.resumable = false; 
     
    20222030                } 
    20232031                catch (ex) { 
    2024                         Debug.dump("header failed! " + d, ex); 
     2032                        Debug.log("header failed! " + d, ex); 
    20252033                        // restart download from the beginning 
    20262034                        d.cancel(); 
     
    20502058 
    20512059                if (visitor.type && visitor.type.search(/application\/metalink\+xml/) != -1) { 
    2052                         Debug.dump(d + " is a metalink"); 
    20532060                        d.isMetalink = true; 
    20542061                        d.resumable = false; 
     
    20882095                if (c.start != 0 && d.is(RUNNING)) { 
    20892096                        if (!this.handleError()) { 
    2090                                 Debug.dump(d + ": Server error or disconnection (type 1)"); 
     2097                                Debug.log(d + ": Server error or disconnection", "(type 1)"); 
    20912098                                d.status = _("servererror"); 
    20922099                                d.pause(); 
     
    21212128                let c = this.c; 
    21222129                let d = this.d; 
    2123                 Debug.dump('StartRequest: ' + c); 
     2130                Debug.logString('StartRequest: ' + c); 
    21242131         
    21252132                this.started = true; 
     
    21692176                                                } 
    21702177                                                if (nsd < tsd) { 
    2171                                                         Debug.dump("nsd", nsd); 
    2172                                                         Debug.dump("tsd", tsd); 
     2178