diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2025-02-05 13:23:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-05 13:23:33 -0800 |
commit | 44740e561fc93afe3ebecfd3618bda2d2abeafb0 (patch) | |
tree | f45d76f0e6e69b71583dd4fc23ac0da4117d863c | |
parent | 38a52caec09eb15c9ff8b4db6f0cdb7e2a28eb98 (diff) | |
download | rneovim-44740e561fc93afe3ebecfd3618bda2d2abeafb0.tar.gz rneovim-44740e561fc93afe3ebecfd3618bda2d2abeafb0.tar.bz2 rneovim-44740e561fc93afe3ebecfd3618bda2d2abeafb0.zip |
fix(log): RPC log format #32337
Problem:
RPC log messages show `log_notify` function name, which is not useful:
DBG 2025-02-04T22:28:02.419 ui.37862 log_notify:57: RPC -> 3: [notify] nvim_ui_set_focus
DBG 2025-02-04T22:28:02.419 nvim.37863.0 log_notify:57: RPC <- 1: [notify] nvim_ui_set_focus
Solution:
Call logmsg() directly.
DBG 2025-02-04T22:42:00.104 ui.40680 RPC: -> 3: [notify] nvim_ui_attach
DBG 2025-02-04T22:42:00.104 ui.40680 RPC: -> 3: [notify] nvim_set_client_info
-rw-r--r-- | src/nvim/msgpack_rpc/channel.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index e92039b99f..e38bc1896d 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -44,17 +44,20 @@ static void log_request(char *dir, uint64_t channel_id, uint32_t req_id, const char *name) { - DLOGN("RPC %s %" PRIu64 ": %s id=%u: %s\n", dir, channel_id, REQ, req_id, name); + logmsg(LOGLVL_DBG, "RPC: ", NULL, -1, false, "%s %" PRIu64 ": %s id=%u: %s\n", dir, channel_id, + REQ, req_id, name); } static void log_response(char *dir, uint64_t channel_id, char *kind, uint32_t req_id) { - DLOGN("RPC %s %" PRIu64 ": %s id=%u\n", dir, channel_id, kind, req_id); + logmsg(LOGLVL_DBG, "RPC: ", NULL, -1, false, "%s %" PRIu64 ": %s id=%u\n", dir, channel_id, kind, + req_id); } static void log_notify(char *dir, uint64_t channel_id, const char *name) { - DLOGN("RPC %s %" PRIu64 ": %s %s\n", dir, channel_id, NOT, name); + logmsg(LOGLVL_DBG, "RPC: ", NULL, -1, false, "%s %" PRIu64 ": %s %s\n", dir, channel_id, NOT, + name); } #else |