feat: update logging with debug logs

This commit is contained in:
Barrett Ruth 2025-09-12 23:21:32 -05:00
parent 5c93bd259e
commit e9f1b06843
5 changed files with 51 additions and 35 deletions

16
lua/cp/log.lua Normal file
View 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