Skip to content

Simplify remote machine logs#387

Open
diegonehab wants to merge 1 commit intomainfrom
feature/simpler-logs
Open

Simplify remote machine logs#387
diegonehab wants to merge 1 commit intomainfrom
feature/simpler-logs

Conversation

@diegonehab
Copy link
Copy Markdown
Contributor

Problem

Since Boost 1.79, boost::system::error_code::what() appends a source_location suffix (file, line, column, full
template-expanded function signature) when the error code was constructed with location data.
Asio constructs all its error codes this way, so every network error log in cartesi-jsonrpc-machine (read request,
send response, accept) includes hundreds of characters of Boost internals regardless of the configured log level.

Solution

Added a file-local format_ec() helper that returns ec.what() (verbose) when the runtime log level is trace or
debug, and ec.message() (plain message only) otherwise.
Replaced ec.what() with format_ec(ec) at all three affected SLOG sites in src/jsonrpc-remote-machine.cpp.

Fixes #381.

@diegonehab diegonehab requested a review from vfusco April 28, 2026 09:50
@diegonehab diegonehab self-assigned this Apr 28, 2026
@diegonehab diegonehab added the enhancement New feature or request label Apr 28, 2026
@diegonehab diegonehab added this to the v0.21.0 milestone Apr 28, 2026
@edubart edubart moved this from Todo to In Progress in Machine Unit Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Improve jsonrpc log messages

2 participants