mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 18:36:30 +00:00
log: Always enable; remove DISABLE_LOG
- Establish ERROR log level as "critical". Such errors are rare and will be valuable when users encounter unusual circumstances. - Set -DMIN_LOG_LEVEL=3 for release-type builds
This commit is contained in:
@@ -370,7 +370,7 @@ static void receive_msgpack(Stream *stream, RBuffer *rbuf, size_t c,
|
||||
char buf[256];
|
||||
snprintf(buf, sizeof(buf), "ch %" PRIu64 " was closed by the client",
|
||||
channel->id);
|
||||
call_set_error(channel, buf);
|
||||
call_set_error(channel, buf, WARNING_LOG_LEVEL);
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -409,7 +409,7 @@ static void parse_msgpack(Channel *channel)
|
||||
"ch %" PRIu64 " returned a response with an unknown request "
|
||||
"id. Ensure the client is properly synchronized",
|
||||
channel->id);
|
||||
call_set_error(channel, buf);
|
||||
call_set_error(channel, buf, ERROR_LOG_LEVEL);
|
||||
}
|
||||
msgpack_unpacked_destroy(&unpacked);
|
||||
// Bail out from this event loop iteration
|
||||
@@ -459,7 +459,7 @@ static void handle_request(Channel *channel, msgpack_object *request)
|
||||
snprintf(buf, sizeof(buf),
|
||||
"ch %" PRIu64 " sent an invalid message, closed.",
|
||||
channel->id);
|
||||
call_set_error(channel, buf);
|
||||
call_set_error(channel, buf, ERROR_LOG_LEVEL);
|
||||
}
|
||||
api_clear_error(&error);
|
||||
return;
|
||||
@@ -564,7 +564,7 @@ static bool channel_write(Channel *channel, WBuffer *buffer)
|
||||
"Before returning from a RPC call, ch %" PRIu64 " was "
|
||||
"closed due to a failed write",
|
||||
channel->id);
|
||||
call_set_error(channel, buf);
|
||||
call_set_error(channel, buf, ERROR_LOG_LEVEL);
|
||||
}
|
||||
|
||||
return success;
|
||||
@@ -795,9 +795,9 @@ static void complete_call(msgpack_object *obj, Channel *channel)
|
||||
}
|
||||
}
|
||||
|
||||
static void call_set_error(Channel *channel, char *msg)
|
||||
static void call_set_error(Channel *channel, char *msg, int loglevel)
|
||||
{
|
||||
ELOG("RPC: %s", msg);
|
||||
LOG(loglevel, "RPC: %s", msg);
|
||||
for (size_t i = 0; i < kv_size(channel->call_stack); i++) {
|
||||
ChannelCallFrame *frame = kv_A(channel->call_stack, i);
|
||||
frame->returned = true;
|
||||
|
@@ -125,7 +125,7 @@ bool server_owns_pipe_address(const char *path)
|
||||
int server_start(const char *endpoint)
|
||||
{
|
||||
if (endpoint == NULL || endpoint[0] == '\0') {
|
||||
ELOG("Empty or NULL endpoint");
|
||||
WLOG("Empty or NULL endpoint");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ int server_start(const char *endpoint)
|
||||
|
||||
result = socket_watcher_start(watcher, MAX_CONNECTIONS, connection_cb);
|
||||
if (result < 0) {
|
||||
ELOG("Failed to start server: %s", uv_strerror(result));
|
||||
WLOG("Failed to start server: %s", uv_strerror(result));
|
||||
socket_watcher_close(watcher, free_server);
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user