aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/notify.lua
blob: b41c7e64f14d2e85115dfae663fad2a8c4eaba0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
local TITLE = "mason.nvim"

return function(msg, level)
    local has_notify_plugin = pcall(require, "notify")
    level = level or vim.log.levels.INFO
    if has_notify_plugin then
        vim.notify(msg, level, {
            title = TITLE,
        })
    else
        vim.notify(("[%s] %s"):format(TITLE, msg), level)
    end
end