feat: update logging with debug logs
This commit is contained in:
parent
5c93bd259e
commit
e9f1b06843
5 changed files with 51 additions and 35 deletions
16
lua/cp/log.lua
Normal file
16
lua/cp/log.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
local M = {}
|
||||
|
||||
local config = nil
|
||||
|
||||
function M.set_config(user_config)
|
||||
config = user_config
|
||||
end
|
||||
|
||||
function M.log(msg, level)
|
||||
level = level or vim.log.levels.INFO
|
||||
if not config or config.debug or level >= vim.log.levels.WARN then
|
||||
vim.notify(("[cp.nvim]: %s"):format(msg), level)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue