Skip to content

Commit d7f10f7

Browse files
author
Minggang Wang
authored
Merge pull request #214 from minggangw/fix-issue-209
Add topic/service name information in debug output.
2 parents 44562cb + 9b5f69a commit d7f10f7

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Client extends Entity {
6363

6464
let rawROSRequest = rclRequest.serialize();
6565
this._sequenceNumber = rclnodejs.sendRequest(this._handle, rawROSRequest);
66-
debug('Client has sent a request.');
66+
debug(`Client has sent a ${this._serviceName} request.`);
6767
this._callback = callback;
6868
}
6969

@@ -73,7 +73,7 @@ class Client extends Entity {
7373

7474
processResponse(response) {
7575
this._response.deserialize(response);
76-
debug('Client has received response from service.');
76+
debug(`Client has received ${this._serviceName} response from service.`);
7777
this._callback(toPlainObject(this._response));
7878
}
7979

lib/publisher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Publisher extends Entity {
5656

5757
let rawRosMessage = rclMessage.serialize();
5858
rclnodejs.publish(this._handle, rawRosMessage);
59-
debug('Message has been published.');
59+
debug(`Message of topic ${this._topic} has been published.`);
6060
}
6161

6262
static createPublisher(nodeHandle, typeClass, topic, qos) {

lib/service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Service extends Entity {
7272

7373
processRequest(headerHandle, request) {
7474
this._request.deserialize(request);
75-
debug('Service has received a request from client.');
75+
debug(`Service has received a ${this._serviceName} request from client.`);
7676

7777
const requestObj = toPlainObject(this._request);
7878
const response = new Response(this, headerHandle);
@@ -83,7 +83,7 @@ class Service extends Entity {
8383
rclnodejs.sendResponse(this._handle, rawROSResponse, headerHandle);
8484
}
8585

86-
debug('Service has processed the request and sent the response.');
86+
debug(`Service has processed the ${this._serviceName} request and sent the response.`);
8787
}
8888

8989
static createService(nodeHandle, serviceName, typeClass, callback, qos) {

lib/subscription.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Subscription extends Entity {
3434

3535
processResponse(msg) {
3636
this._message.deserialize(msg);
37-
debug('Message received.');
37+
debug(`Message of topic ${this._topic} received.`);
3838
this._callback(toPlainObject(this._message));
3939
}
4040

0 commit comments

Comments
 (0)