log: log_uv_handles

This commit is contained in:
Justin M. Keyes
2017-05-28 21:20:49 +02:00
parent cb0abce5be
commit f83d733318

View File

@@ -7,6 +7,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <uv.h>
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/types.h" #include "nvim/types.h"
@@ -97,6 +98,25 @@ end:
return ret; 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. /// Open the log file for appending.
/// ///
/// @return The FILE* specified by the USR_LOG_FILE path or stderr in case of /// @return The FILE* specified by the USR_LOG_FILE path or stderr in case of