SHIMODA Piro Hiroshi
null+****@clear*****
Mon Oct 6 17:27:28 JST 2014
SHIMODA "Piro" Hiroshi 2014-10-06 17:27:28 +0900 (Mon, 06 Oct 2014) New Revision: b9b6c5aaca603bc88a6c6f7d82242ebfe21facb0 https://github.com/droonga/express-droonga/commit/b9b6c5aaca603bc88a6c6f7d82242ebfe21facb0 Message: Use the log level "debug" suppored by winston, instead of "trace" Modified files: lib/adapter/http.js lib/droonga-protocol/connection.js lib/droonga-protocol/receiver.js test/test-utils.js Modified: lib/adapter/http.js (+5 -5) =================================================================== --- lib/adapter/http.js 2014-10-06 17:17:28 +0900 (3faad93) +++ lib/adapter/http.js 2014-10-06 17:27:28 +0900 (d5144d3) @@ -10,7 +10,7 @@ function createRequestResponseHandler(params) { var logger = definition.logger; return (function(request, response) { - logger.trace('adapter.http.createRequestResponseHandler.handle'); + logger.debug('adapter.http.createRequestResponseHandler.handle'); var timeout = definition.timeout || null; var options = { @@ -18,13 +18,13 @@ function createRequestResponseHandler(params) { timeout: timeout }; var callback = function(error, message) { - logger.trace('adapter.http.createRequestResponseHandler.handle.response'); + logger.debug('adapter.http.createRequestResponseHandler.handle.response'); if (error) { - logger.trace('adapter.http.createRequestResponseHandler.handle.response.error:', error); + logger.debug('adapter.http.createRequestResponseHandler.handle.response.error:', error); var body = message && message.body || null; response.jsonp(error, body); } else { - logger.trace('adapter.http.createRequestResponseHandler.handle.response.success'); + logger.debug('adapter.http.createRequestResponseHandler.handle.response.success'); var body = message.body; if (definition.onResponse) { definition.onResponse(body, response); @@ -71,7 +71,7 @@ function createGenericHandler(params) { var definition = params.definition; return (function(request, response) { - logger.trace('adapter.http.createGenericHandler.handle'); + logger.debug('adapter.http.createGenericHandler.handle'); var options = { dataset: definition.dataset, Modified: lib/droonga-protocol/connection.js (+5 -5) =================================================================== --- lib/droonga-protocol/connection.js 2014-10-06 17:17:28 +0900 (51783ca) +++ lib/droonga-protocol/connection.js 2014-10-06 17:27:28 +0900 (20afff7) @@ -113,7 +113,7 @@ Connection.prototype._initReceiver = function() { }).bind(this)); var tag = this.tag + '.message'; - this._logger.trace('Connection._initReceiver %d: %d %d:', + this._logger.debug('Connection._initReceiver %d: %d %d:', this._id, receiver._id, this.receivePort, tag); this._receiver = receiver; this._receiver.on(tag, @@ -128,13 +128,13 @@ Connection.prototype._handleMessage = function(envelope) { var inReplyTo = envelope.inReplyTo; if (inReplyTo) { delete this._sendingMessages[inReplyTo]; - this._logger.trace('Connection._handleMessage.reply %d:', this._id, inReplyTo); + this._logger.debug('Connection._handleMessage.reply %d:', this._id, inReplyTo); var errorCode = envelope.statusCode; if (!errorCode || isSuccess(errorCode)) errorCode = null; this.emit('reply:' + inReplyTo, errorCode, envelope); } else { - this._logger.trace('Connection._handleMessage.message %d:', this._id, envelope.type); + this._logger.debug('Connection._handleMessage.message %d:', this._id, envelope.type); this.emit(envelope.type, envelope); } }; @@ -186,7 +186,7 @@ Connection.prototype.emitMessage = function(type, body, callback, options) { } var id = createId(); - this._logger.trace('Connection.emitMessage %d:', this._id, id, type); + this._logger.debug('Connection.emitMessage %d:', this._id, id, type); var from = this.getRouteToSelf(options); var envelope = { id: id, @@ -202,7 +202,7 @@ Connection.prototype.emitMessage = function(type, body, callback, options) { var event = 'reply:' + id; var timeoutId; this.once(event, function(errorCode, response) { - this._logger.trace('Connection.emitMessage.reply %d:', this._id, errorCode); + this._logger.debug('Connection.emitMessage.reply %d:', this._id, errorCode); clearTimeout(timeoutId); callback(errorCode, response); }); Modified: lib/droonga-protocol/receiver.js (+3 -3) =================================================================== --- lib/droonga-protocol/receiver.js 2014-10-06 17:17:28 +0900 (e2efff4) +++ lib/droonga-protocol/receiver.js 2014-10-06 17:27:28 +0900 (3073918) @@ -36,7 +36,7 @@ MsgPackReceiver.prototype._onConnect = function(socket) { }; MsgPackReceiver.prototype._onMessageReceive = function(data) { - this._logger.trace('MsgPackReceiver._onMessageReceive %d:', this._id); + this._logger.debug('MsgPackReceiver._onMessageReceive %d:', this._id); this.emit('receive', data); }; @@ -87,11 +87,11 @@ FluentReceiver.prototype._onMessageReceive = function(packet) { if (packet.length == 3) { // Message type var tag = packet[0]; var response = packet[2]; - this._logger.trace('FluentReceiver._onMessageReceive.message %d', this._id, tag); + this._logger.debug('FluentReceiver._onMessageReceive.message %d', this._id, tag); this.emit(tag, response); } else { // Forward type - this._logger.trace('FluentReceiver._onMessageReceive.forward %d', this._id, packet); + this._logger.debug('FluentReceiver._onMessageReceive.forward %d', this._id, packet); packet[1].forEach(function(entry) { this.emit(packet[0], entry[1]); }, this); Modified: test/test-utils.js (+1 -1) =================================================================== --- test/test-utils.js 2014-10-06 17:17:28 +0900 (6d89faa) +++ test/test-utils.js 2014-10-06 17:27:28 +0900 (0277afb) @@ -259,7 +259,7 @@ function createBackend() { backend.clearMessages(); backend.on('receive', function(data) { - console.trace('test-utils.createBackend.receive %d', backend._id); + console.debug('test-utils.createBackend.receive %d', backend._id); backend.received.push(data); if (backend.reservedResponses.length > 0) { var response = backend.reservedResponses.shift(); -------------- next part -------------- HTML����������������������������...Télécharger