Skip to content

Commit

Permalink
feat: log received messages in ChatSession subscriber for better debu…
Browse files Browse the repository at this point in the history
…gging
  • Loading branch information
milyin committed Dec 12, 2024
1 parent 5454e92 commit 03a7c78
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions zenoh-ts/examples/chat/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class ChatSession {
this.messages_publisher = this.session.declare_publisher(keyexpr, {});

this.message_subscriber = await this.session.declare_subscriber(keyexpr, (sample) => {
log(`[Subscriber] Received message: ${sample.payload.toString()} from ${sample.keyexpr().toString()}`);
if (this.messageCallback) {
this.messageCallback(sample.payload.toString());
}
Expand Down

0 comments on commit 03a7c78

Please sign in to comment.