mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 06:30:03 +08:00
24 lines
453 B
Lua
24 lines
453 B
Lua
local M = {}
|
|
local log_levels = vim.log.levels
|
|
local s_log_level = log_levels.INFO
|
|
|
|
local logger = require("spacevim.logger").derive("zettel")
|
|
|
|
function M.set_level(level)
|
|
s_log_level = level
|
|
end
|
|
|
|
function M.notify(msg, level, opts)
|
|
if level >= s_log_level then
|
|
local tag = opts.tag or "[zettelkasten]"
|
|
vim.notify(tag .. " " .. msg, level, opts)
|
|
end
|
|
end
|
|
|
|
function M.info(msg) -- {{{
|
|
logger.info(msg)
|
|
end
|
|
-- }}}
|
|
|
|
return M
|