Skip to content

Commit

Permalink
chore(debug): clean up some debug message output
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Mar 7, 2017
1 parent 9c04651 commit 1967abd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions lib/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function Link(session, handle, linkPolicy) {
var self = this;
this.sm = new StateMachine(stateMachine(this));
this.sm.bind(function(event, oldState, newState) {
debug('stateChange(', self.id, '):', oldState, '=>', newState, ', reason:', event);
debug('stateChange(' + self.id + '):', oldState, '=>', newState, ', reason:', event);
});
}

Expand Down Expand Up @@ -146,7 +146,6 @@ Link.prototype.attach = function() {
this.sm.sendAttach();
var attachFrame = new frames.AttachFrame(this.policy.attach);
attachFrame.channel = this.session.channel;
debug('attach CH=' + attachFrame.channel + ', Handle=' + attachFrame.handle);

this.name = attachFrame.name;
this.role = attachFrame.role;
Expand All @@ -166,7 +165,7 @@ Link.prototype.forceDetach = function() {
return;
}

debug('force detach for ' + this.name + '. current state: ' + state);
debug('forceDetach(' + this.id + '): current state:', state);
if (!!this._reattachTimer) clearTimeout(this._reattachTimer);
this.sm.forceDetach();
this.emit(Link.Detached, {
Expand Down Expand Up @@ -270,7 +269,7 @@ Link.prototype._attemptReattach = function() {
self.sm.reattach();
self._reattachTimer = setTimeout(function() {
if (self.shouldReattach()) {
debug('attempting to reattach ' + self.id);
debug('attempting to reattach: ' + self.id);
self.attach();
} else {
process.nextTick(function() { self._attemptReattach(); });
Expand Down
2 changes: 1 addition & 1 deletion lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function Session(conn) {
var self = this;
this.sessionSM = new StateMachine(stateMachine);
this.sessionSM.bind(function(event, oldState, newState) {
debug('stateChange(', self.remoteChannel, '):', oldState, '=>', newState, ', reason:', event);
debug('stateChange(' + self.remoteChannel + '):', oldState, '=>', newState, ', reason:', event);
});
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/mock_amqp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var BufferList = require('bl'),
debug = require('debug')('amqp10-MockServer'),
debug = require('debug')('amqp10:mock:server'),
net = require('net'),
expect = require('chai').expect,
frames = require('../../lib/frames'),
Expand Down

0 comments on commit 1967abd

Please sign in to comment.