diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/auevents.lua | 3 | ||||
-rw-r--r-- | src/nvim/log.c | 21 | ||||
-rw-r--r-- | src/nvim/map.c | 12 |
3 files changed, 24 insertions, 12 deletions
diff --git a/src/nvim/auevents.lua b/src/nvim/auevents.lua index 32a7920b6e..ef528f72b8 100644 --- a/src/nvim/auevents.lua +++ b/src/nvim/auevents.lua @@ -65,7 +65,6 @@ return { 'InsertCharPre', -- before inserting a char 'InsertEnter', -- when entering Insert mode 'InsertLeave', -- when leaving Insert mode - 'JobActivity', -- when job sent some data 'MenuPopup', -- just before popup menu is displayed 'OptionSet', -- after setting any option 'QuickFixCmdPost', -- after :make, :grep etc. @@ -89,7 +88,7 @@ return { 'TabNew', -- when creating a new tab 'TabNewEntered', -- after entering a new tab 'TermChanged', -- after changing 'term' - 'TermClose', -- after the processs exits + 'TermClose', -- after the process exits 'TermOpen', -- after opening a terminal buffer 'TermResponse', -- after setting "v:termresponse" 'TextChanged', -- text was modified diff --git a/src/nvim/log.c b/src/nvim/log.c index 8066b6e828..a2f83d4d09 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -1,6 +1,13 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// +// Log module +// +// How Linux printk() handles recursion, buffering, etc: +// https://lwn.net/Articles/780556/ +// + #include <assert.h> #include <inttypes.h> #include <stdarg.h> @@ -99,9 +106,14 @@ void log_unlock(void) uv_mutex_unlock(&mutex); } -/// @param context description of a shared context or subsystem -/// @param func_name function name, or NULL -/// @param line_num source line number, or -1 +/// Logs a message to $NVIM_LOG_FILE. +/// +/// @param log_level Log level (see log.h) +/// @param context Description of a shared context or subsystem +/// @param func_name Function name, or NULL +/// @param line_num Source line number, or -1 +/// @param eol Append linefeed "\n" +/// @param fmt printf-style format string bool logmsg(int log_level, const char *context, const char *func_name, int line_num, bool eol, const char *fmt, ...) FUNC_ATTR_UNUSED FUNC_ATTR_PRINTF(6, 7) @@ -163,7 +175,8 @@ end: FILE *open_log_file(void) { static bool opening_log_file = false; - // check if it's a recursive call + // Disallow recursion. (This only matters for log_path_init; for logmsg and + // friends we use a mutex: log_lock). if (opening_log_file) { do_log_to_file(stderr, ERROR_LOG_LEVEL, NULL, __func__, __LINE__, true, "Cannot LOG() recursively."); diff --git a/src/nvim/map.c b/src/nvim/map.c index 9b6f57a56f..90da27cf9f 100644 --- a/src/nvim/map.c +++ b/src/nvim/map.c @@ -1,12 +1,12 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -/// -/// map.c: khash.h wrapper -/// -/// NOTE: Callers must manage memory (allocate) for keys and values. -/// khash.h does not make its own copy of the key or value. -/// +// +// map.c: khash.h wrapper +// +// NOTE: Callers must manage memory (allocate) for keys and values. +// khash.h does not make its own copy of the key or value. +// #include <stdlib.h> #include <stdbool.h> |