mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
log: log_uv_handles
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <uv.h>
|
||||
|
||||
#include "nvim/log.h"
|
||||
#include "nvim/types.h"
|
||||
@@ -97,6 +98,25 @@ end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void log_uv_handles(void *loop)
|
||||
{
|
||||
uv_loop_t *l = loop;
|
||||
log_lock();
|
||||
FILE *log_file = open_log_file();
|
||||
|
||||
if (log_file == NULL) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
uv_print_all_handles(l, log_file);
|
||||
|
||||
if (log_file != stderr && log_file != stdout) {
|
||||
fclose(log_file);
|
||||
}
|
||||
end:
|
||||
log_unlock();
|
||||
}
|
||||
|
||||
/// Open the log file for appending.
|
||||
///
|
||||
/// @return The FILE* specified by the USR_LOG_FILE path or stderr in case of
|
||||
|
Reference in New Issue
Block a user