aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-05-28 21:20:49 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-06-07 00:26:19 +0200
commitf83d733318d27ed8ad9fc7a442142ee8a74b7a39 (patch)
tree07877737260a364c6f30f4afb632a009e9134ee2
parentcb0abce5be1dd6212425589b61826332834dc977 (diff)
downloadrneovim-f83d733318d27ed8ad9fc7a442142ee8a74b7a39.tar.gz
rneovim-f83d733318d27ed8ad9fc7a442142ee8a74b7a39.tar.bz2
rneovim-f83d733318d27ed8ad9fc7a442142ee8a74b7a39.zip
log: log_uv_handles
-rw-r--r--src/nvim/log.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/log.c b/src/nvim/log.c
index d059e28d5d..14cf0be7b0 100644
--- a/src/nvim/log.c
+++ b/src/nvim/log.c
@@ -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