diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-23 19:13:31 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-23 21:46:03 -0300 |
commit | 64844b7312150e5c7e66997c1b0b4b7668acdd71 (patch) | |
tree | 5b0dc4ec448deed5e8eae36b2dea7312e68bff71 /scripts/msgpack-gen.lua | |
parent | f05fead12e380fa63dc99ceb65332569e4e06c43 (diff) | |
download | rneovim-64844b7312150e5c7e66997c1b0b4b7668acdd71.tar.gz rneovim-64844b7312150e5c7e66997c1b0b4b7668acdd71.tar.bz2 rneovim-64844b7312150e5c7e66997c1b0b4b7668acdd71.zip |
msgpack-rpc: Improve logging of msgpack-rpc messages
- Expose more logging control from the log.c module(get log stream and omit
newlines)
- Remove logging from the generated functions in msgpack-gen.lua
- Refactor channel.c/helpers.c to log every msgpack-rpc payload using
msgpack_object_print(a helper function from msgpack.h)
- Remove the api_stringify function, it was only useful for logging msgpack-rpc
which is now handled by msgpack_object_print.
Diffstat (limited to 'scripts/msgpack-gen.lua')
-rw-r--r-- | scripts/msgpack-gen.lua | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/scripts/msgpack-gen.lua b/scripts/msgpack-gen.lua index 284956a43c..9645784f00 100644 --- a/scripts/msgpack-gen.lua +++ b/scripts/msgpack-gen.lua @@ -164,13 +164,6 @@ for i = 1, #functions do output:write('static Object handle_'..fn.name..'(uint64_t channel_id, uint64_t request_id, Array args, Error *error)') output:write('\n{') - output:write('\n') - output:write('\n#if MIN_LOG_LEVEL <= DEBUG_LOG_LEVEL\n {') - output:write('\n char *args_repr = api_stringify(ARRAY_OBJ(args));') - output:write('\n DLOG("msgpack-rpc request received(id: %" PRIu64 ", method: '..fn.name..' , arguments: %s)", request_id, args_repr);') - output:write('\n free(args_repr);') - output:write('\n }\n#endif') - output:write('\n') output:write('\n Object ret = NIL;') -- Declare/initialize variables that will hold converted arguments for j = 1, #fn.parameters do @@ -235,7 +228,6 @@ for i = 1, #functions do end -- and check for the error output:write('\n if (error->set) {') - output:write('\n DLOG("msgpack-rpc request failed(id: %" PRIu64 ", method: '..fn.name..' , error: %s)", request_id, error->msg);') output:write('\n goto cleanup;') output:write('\n }\n') else @@ -245,11 +237,6 @@ for i = 1, #functions do if fn.return_type ~= 'void' then output:write('\n ret = '..string.upper(real_type(fn.return_type))..'_OBJ(rv);') end - output:write('\n#if MIN_LOG_LEVEL <= DEBUG_LOG_LEVEL\n {') - output:write('\n char *rv_repr = api_stringify(ret);') - output:write('\n DLOG("msgpack-rpc request succeeded(id: %" PRIu64 ", method: '..fn.name..' , return value: %s)", request_id, rv_repr);') - output:write('\n free(rv_repr);') - output:write('\n }\n#endif') -- Now generate the cleanup label for freeing memory allocated for the -- arguments output:write('\n\ncleanup:'); |