diff options
author | kylo252 <[email protected]> | 2021-10-21 17:51:22 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-10-21 17:51:22 +0200 |
commit | 212fdadce413486fc4a5a5f1e0e09bd0eefd87c3 (patch) | |
tree | ed22336226ef9ec23b8167bd2a8f6fcb1c42a411 /lua | |
parent | 25747cfff457d5375b6141588d81017ca515ffcb (diff) |
fix: handle vim.notify when missing a log level (#1818)
Diffstat (limited to 'lua')
-rw-r--r-- | lua/lvim/core/log.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/lvim/core/log.lua b/lua/lvim/core/log.lua index 9ddc641f..688246f4 100644 --- a/lua/lvim/core/log.lua +++ b/lua/lvim/core/log.lua @@ -89,6 +89,10 @@ function Log:init() -- Overwrite vim.notify to use the logger vim.notify = function(msg, vim_log_level, opts) nvim_notify_params = opts or {} + -- vim_log_level can be omitted + if type(vim_log_level) == "string" then + vim_log_level = Log.levels[(vim_log_level):upper() or "INFO"] + end -- https://github.com/neovim/neovim/blob/685cf398130c61c158401b992a1893c2405cd7d2/runtime/lua/vim/lsp/log.lua#L5 logger:log(vim_log_level + 1, msg) end |