Skip to content

debug log sent/received payload#27

Merged
senid231 merged 1 commit into
masterfrom
debug-log-payload
May 29, 2026
Merged

debug log sent/received payload#27
senid231 merged 1 commit into
masterfrom
debug-log-payload

Conversation

@senid231

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown
Package Line Rate Branch Rate Complexity Health
jrpc 93% 81% 0
Summary 93% (792 / 854) 81% (238 / 294) 0

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds opt-in debug-level wire payload logging to both SimpleClient and SharedClient via a small shared PayloadLogging mixin. When a logger: is configured, each raw JSON frame sent/received is emitted at DEBUG with >>/<< markers; otherwise it's a no-op.

Changes:

  • Introduces JRPC::PayloadLogging mixin providing log_sent/log_received helpers and includes it in SimpleClient and SharedClient::TransportLoop.
  • Wires log_sent/log_received calls around write_frame/read_frame in both clients, and refactors log_error to use the new log_tag helper.
  • Documents the behavior in the README and CHANGELOG, and adds RSpec coverage (plus stubs debug: nil on existing instance_double(Logger, ...) test doubles).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/jrpc/payload_logging.rb New mixin with log_sent/log_received helpers, no-op without a logger.
lib/jrpc.rb Requires the new payload_logging file.
lib/jrpc/simple_client.rb Includes mixin, logs sent/received frames around transport I/O, defines log_tag.
lib/jrpc/shared_client/transport_loop.rb Includes mixin, logs sent/received frames, switches log_error to use log_tag.
README.md Documents the logger: DEBUG payload-logging behavior.
CHANGELOG.md Adds a "New" entry describing the feature.
spec/simple_client_spec.rb Adds a debug payload logging describe block covering request, notification, and no-logger cases.
spec/shared_client_spec.rb Adds a debug-logging test and stubs debug: nil on existing logger doubles.
spec/shared_client/fiber_spec.rb Stubs debug: nil on the cancellation-test logger double.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@senid231 senid231 merged commit 9f41979 into master May 29, 2026
3 checks passed
@senid231 senid231 deleted the debug-log-payload branch May 29, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants