Changeset 13755

Show
Ignore:
Timestamp:
05/16/08 22:20:25 (14 months ago)
Author:
gregw
Message:

fixed #6776 reduced console.log entries

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojox/trunk/cometd/_base.js

    r13753 r13755  
    101101                this.url = root||dojo.config["cometdRoot"]; 
    102102                if(!this.url){ 
    103                         console.debug("no cometd root specified in djConfig and no root passed"); 
     103                        throw "no cometd root"; 
    104104                        return null; 
    105105                } 
     
    137137                        }), 
    138138                        error: dojo.hitch(this,function(e){ 
    139                                 console.debug("handshake error!:",e); 
    140139                                this._backoff(); 
    141140                                this._finishInit([{}]); 
     
    143142                        timeoutSeconds: this.expectedNetworkDelay/1000, 
    144143                        timeout: dojo.hitch(this, function(){ 
    145                                 console.debug("handshake timeout!"); 
    146144                                this._backoff(); 
    147145                                this._finishInit([{}]); 
     
    389387                } 
    390388                this._initialized=false; 
     389                this._handshook=false; 
    391390                dojo.publish("/cometd/meta", [{cometd:this,action:"disconnect",successful:true,state:this.state()}]); 
    392391        } 
     
    429428                var i=this._backoffInterval+(this._advice?(this._advice.interval?this._advice.interval:0):0); 
    430429                if (i>0){ 
    431                         console.debug("Retry in interval+backoff="+this._advice.interval+"+"+this._backoffInterval+"="+i+"ms"); 
     430                        if (console.log) 
     431                            console.log("Retry in interval+backoff="+this._advice.interval+"+"+this._backoffInterval+"="+i+"ms"); 
    432432                } 
    433433                return i; 
     
    450450                // check version 
    451451                if(data.version < this.minimumVersion){ 
    452                         console.debug("cometd protocol version mismatch. We wanted", this.minimumVersion, "but got", data.version); 
     452                        if (console.log) 
     453                            console.log("cometd protocol version mismatch. We wanted", this.minimumVersion, "but got", data.version); 
    453454                        successful=false; 
    454455                        this._advice.reconnect="none"; 
     
    477478                }else{ 
    478479                        // If there is a problem 
    479                         console.debug("cometd init failed"); 
     480                        if (console.log) 
     481                                console.log("cometd init failed"); 
    480482                        // follow advice 
    481                         if(this._advice && this._advice["reconnect"]=="none"){ 
    482                                 console.debug("cometd reconnect: none"); 
    483                         }else{ 
     483                        if(!this._advice || this._advice["reconnect"]!="none"){ 
    484484                                setTimeout(dojo.hitch(this, "init", this.url, this._props),this._interval()); 
    485485                        } 
     
    518518                if(!message["channel"]){ 
    519519                        if(message["success"] !== true){ 
    520                                 console.debug("cometd error: no channel for message!", message); 
    521520                                return; 
    522521                        } 
     
    606605                                dojo.publish(tname,messages); 
    607606                        }catch(e){ 
    608                                 console.debug(e); 
     607                                if (console.log) 
     608                                        console.log(e); 
    609609                        } 
    610610                } 
     
    612612 
    613613        this._sendMessage = function(/* object */ message){ 
    614                 // console.debug(this.currentTransport, this._connected, this.batch); 
    615                 // if(this.currentTransport && this._connected && !this.batch){ 
    616614                if(this.currentTransport && !this.batch){ 
    617615                        return this.currentTransport.sendMessages([message]); 
     
    736734                         
    737735                if(this._cometd._advice && this._cometd._advice["reconnect"]=="none"){ 
    738                         console.debug("cometd reconnect: none"); 
    739736                        return; 
    740737                } 
     
    745742                if(!this._cometd._initialized){ return; } 
    746743                if(this._cometd._polling) { 
    747                         console.debug("wait for poll to complete or fail"); 
    748744                        return; 
    749745                } 
     
    786782                        error: dojo.hitch(this, function(err){ 
    787783                                this._cometd._polling=false; 
    788                                 console.debug("tunnel opening failed:", err); 
    789784                                dojo.publish("/cometd/meta", [{cometd:this._cometd,action:"connect",successful:false,state:this._cometd.state()}]); 
    790785                                this._cometd._backoff(); 
     
    811806                        handleAs: this._cometd.handleAs, 
    812807                        load: dojo.hitch(this._cometd, "deliver"), 
    813                         error: dojo.hitch(this, function(err){ 
    814                                 console.debug('dropped messages: ',messages); 
    815                         }), 
    816808                        content: { 
    817809                                message: dojo.toJson(messages) 
     
    899891                        error: dojo.hitch(this, function(err){ 
    900892                                this._cometd._polling=false; 
    901                                 console.debug("tunnel opening failed:", err); 
    902893                                dojo.publish("/cometd/meta", [{cometd:this._cometd,action:"connect",successful:false,state:this._cometd.state()}]); 
    903894                                this._cometd._backoff();