Skip to content

Commit e9992fa

Browse files
author
Adam Rudd
committed
Add more logging to orig
1 parent aec2e12 commit e9992fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/server/orig.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ mqtt.createServer(function(client) {
1717
client.on('subscribe', function(packet) {
1818
var granted = [];
1919

20+
console.log("SUBSCRIBE(%s): %j", client.id, packet);
21+
2022
for (var i = 0; i < packet.subscriptions.length; i++) {
2123
var qos = packet.subscriptions[i].qos
2224
, topic = packet.subscriptions[i].topic
@@ -30,6 +32,7 @@ mqtt.createServer(function(client) {
3032
});
3133

3234
client.on('publish', function(packet) {
35+
console.log("PUBLISH(%s): %j", client.id, packet);
3336
for (var k in self.clients) {
3437
var c = self.clients[k]
3538
, publish = false;
@@ -49,7 +52,7 @@ mqtt.createServer(function(client) {
4952
});
5053

5154
client.on('pingreq', function(packet) {
52-
console.log('Ping from client ' + client.id);
55+
console.log('PINGREQ(%s)', client.id);
5356
client.pingresp();
5457
});
5558

0 commit comments

Comments
 (0)