From ebb3894b3bcce06768f3cf7052e00d163a57f239 Mon Sep 17 00:00:00 2001 From: Smirnov Oleksandr Date: Mon, 27 Jun 2022 14:30:02 +0300 Subject: [PATCH] fix(_utils): set notification level --- lua/gopher/_utils/init.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lua/gopher/_utils/init.lua b/lua/gopher/_utils/init.lua index bb25bf8..6f41e22 100644 --- a/lua/gopher/_utils/init.lua +++ b/lua/gopher/_utils/init.lua @@ -38,10 +38,19 @@ return { end, ---@param msg string - ---@param lvl string + ---@param lvl string|integer notify = function(msg, lvl) + local l + if lvl == "error" or lvl == 4 then + l = vim.log.levels.ERROR + elseif lvl == "info" or lvl == 2 then + l = vim.log.levels.INFO + elseif lvl == "debug" or lvl == 1 then + l = vim.log.levels.DEBUG + end + vim.defer_fn(function() - vim.notify(msg, lvl) + vim.notify(msg, l) end, 0) end, }