From 1967abd7a79efba02897305a058992bdef220520 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Sat, 4 Mar 2017 14:35:31 -0500 Subject: [PATCH] chore(debug): clean up some debug message output --- lib/link.js | 7 +++---- lib/session.js | 2 +- test/unit/mock_amqp.js | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/link.js b/lib/link.js index 4defec5..8926afc 100644 --- a/lib/link.js +++ b/lib/link.js @@ -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); }); } @@ -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; @@ -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, { @@ -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(); }); diff --git a/lib/session.js b/lib/session.js index 449e4af..be9b791 100644 --- a/lib/session.js +++ b/lib/session.js @@ -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); }); } diff --git a/test/unit/mock_amqp.js b/test/unit/mock_amqp.js index 37bb44e..cca0fb9 100644 --- a/test/unit/mock_amqp.js +++ b/test/unit/mock_amqp.js @@ -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'),