debug: Improve debugging of msgpack-rpc requests

- Add the api_stringify function to display API objects
- Use api_stringify to display request arguments and return values in DLOG
  statements.
This commit is contained in:
Thiago de Arruda
2014-10-22 10:45:54 -03:00
parent 4233446344
commit b31a74ad11
3 changed files with 111 additions and 6 deletions

View File

@@ -461,15 +461,10 @@ static void call_request_handler(Channel *channel,
msgpack_packer_init(&response, &out_buffer, msgpack_sbuffer_write);
if (error.set) {
ELOG("Error dispatching msgpack-rpc call: %s(request: id %" PRIu64 ")",
error.msg,
request_id);
channel_write(channel,
serialize_response(request_id, &error, NIL, &out_buffer));
}
DLOG("Successfully completed mspgack-rpc call(request id: %" PRIu64 ")",
request_id);
channel_write(channel,
serialize_response(request_id, &error, result, &out_buffer));
}