2021-10-22 23:46:43 +02:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M.config()
|
|
|
|
local pallete = require "onedarker.palette"
|
2021-10-23 13:11:05 +02:00
|
|
|
|
2021-10-22 23:46:43 +02:00
|
|
|
lvim.builtin.notify = {
|
|
|
|
active = false,
|
|
|
|
on_config_done = nil,
|
|
|
|
-- TODO: update after https://github.com/rcarriga/nvim-notify/pull/24
|
|
|
|
opts = {
|
2021-10-23 13:11:05 +02:00
|
|
|
---@usage Animation style one of { "fade", "slide", "fade_in_slide_out", "static" }
|
|
|
|
stages = "slide",
|
2021-10-22 23:46:43 +02:00
|
|
|
|
2021-10-23 13:11:05 +02:00
|
|
|
---@usage timeout for notifications in ms, default 5000
|
2021-10-22 23:46:43 +02:00
|
|
|
timeout = 5000,
|
|
|
|
|
2021-10-23 13:11:05 +02:00
|
|
|
---@usage highlight behind the window for stages that change opacity
|
2021-10-22 23:46:43 +02:00
|
|
|
background_colour = pallete.fg,
|
|
|
|
|
|
|
|
---@usage Icons for the different levels
|
|
|
|
icons = {
|
2021-10-23 13:11:05 +02:00
|
|
|
ERROR = "",
|
|
|
|
WARN = "",
|
|
|
|
INFO = "",
|
2021-10-22 23:46:43 +02:00
|
|
|
DEBUG = "",
|
|
|
|
TRACE = "✎",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2021-10-23 13:11:05 +02:00
|
|
|
M.params_injecter = function(_, entry)
|
|
|
|
-- FIXME: this is currently getting ignored or is not passed correctly
|
|
|
|
for key, value in pairs(lvim.builtin.notify.opts) do
|
|
|
|
entry[key] = value
|
|
|
|
end
|
|
|
|
return entry
|
|
|
|
end
|
|
|
|
|
|
|
|
M.default_namer = function(logger, entry)
|
|
|
|
entry["title"] = logger.name
|
|
|
|
return entry
|
|
|
|
end
|
|
|
|
|
2021-10-22 23:46:43 +02:00
|
|
|
return M
|