Permalink
Browse files

Fixed forced debugging. Now only shows when it's asked for.

  • Loading branch information...
Trakkasure committed May 31, 2011
1 parent de2cd65 commit ebeb50fbccc80f5d1652a0630f7f2a3d077462e0
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/index.js
View
@@ -375,14 +375,14 @@ function Connection(instance) {
if (!instance.channel[id]) throw('Channel does not exist for ID '+id);
// Make sure that the channel closes itself... so that remaining commands will execute.
if (!instance.channel[id].closed()) return instance.channel[id].close();
- //if (instance.debug>0)
+ if (instance.debug>0)
util.debug('Closing '+this.getHost()+' channel: '+id);
delete instance.channel[id];
if (Object.keys(instance.channel).length==0 && (instance.closing || instance.closeOnDone)) this.close();
},
close:function(force) {
if (!this.connected()) {
- //if (instance.debug>0)
+ if (instance.debug>0)
util.log('Connection disconnected: '+this.getHost());
instance.socket.destroy();
instance.connected=false;
@@ -396,13 +396,13 @@ function Connection(instance) {
console.log('deferring closing connection');
return;
}
- //if (instance.debug>0)
+ if (instance.debug>0)
util.log('Connection disconnecting: '+this.getHost());
instance.removeAllListeners('done');
var self=this;
if (force) Object.keys(instance.channel).forEach(function(e){self.channel[e].close(true);});
this.once('fatal',function(d){ // quit command ends with a fatal.
- //if (instance.debug>0)
+ if (instance.debug>0)
util.log('Connection disconnected: '+this.getHost());
instance.socket.destroy();
instance.connected=false;
@@ -547,7 +547,7 @@ function Channel(instance) {
this.closing(true);
if (this.closed()||!force&&(instance.commands.length||this.running())) return;
if (this.running()) this.getConnection().write(['/cancel','=tag='+this.getId()]);
- //if (this.getConnection().debug>1)
+ if (this.getConnection().debug>1)
util.debug('Closing host:channel: '+this.getConnection().getHost()+':'+this.getId());
this.closed(true);
this.getConnection().closeChannel(this.getId());

0 comments on commit ebeb50f

Please sign in to comment.