log: RPC, input, other events

This commit is contained in:
Justin M. Keyes 2018-09-18 23:26:03 +02:00
parent b9bcfa9bc8
commit 7c00b9efca
5 changed files with 13 additions and 0 deletions

View File

@ -190,6 +190,9 @@ for i = 1, #functions do
output:write('Object handle_'..fn.name..'(uint64_t channel_id, Array args, Error *error)')
output:write('\n{')
output:write('\n#if MIN_LOG_LEVEL <= DEBUG_LOG_LEVEL')
output:write('\n logmsg(DEBUG_LOG_LEVEL, "RPC: ", NULL, -1, true, "invoke '..fn.name..'");')
output:write('\n#endif')
output:write('\n Object ret = NIL;')
-- Declare/initialize variables that will hold converted arguments
for j = 1, #fn.parameters do

View File

@ -358,6 +358,7 @@ static void handle_request(Channel *channel, msgpack_object *request)
}
} else {
multiqueue_put(channel->events, on_request_event, 1, evdata);
DLOG("RPC: scheduled %.*s", method->via.bin.size, method->via.bin.ptr);
}
}

View File

@ -351,6 +351,8 @@ static bool input_poll(int ms)
blocking = true;
multiqueue_process_events(ch_before_blocking_events);
}
DLOG("blocking... events_enabled=%d events_pending=%d", events_enabled,
!multiqueue_empty(main_loop.events));
LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, ms, input_ready() || input_eof);
blocking = false;

View File

@ -153,6 +153,7 @@ void mch_exit(int r)
free_all_mem();
#endif
ILOG("Nvim exit: %d", r);
exit(r);
}

View File

@ -64,6 +64,12 @@ getkey:
may_sync_undo();
}
#if MIN_LOG_LEVEL <= DEBUG_LOG_LEVEL
char *keyname = key == K_EVENT
? "K_EVENT" : (char *)get_special_key_name(key, mod_mask);
DLOG("input: %s", keyname);
#endif
int execute_result = s->execute(s, key);
if (!execute_result) {
break;