notify.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. local M = {}
  2. function M.config()
  3. local pallete = require "onedarker.palette"
  4. lvim.builtin.notify = {
  5. active = false,
  6. on_config_done = nil,
  7. -- TODO: update after https://github.com/rcarriga/nvim-notify/pull/24
  8. opts = {
  9. ---@usage Animation style one of { "fade", "slide", "fade_in_slide_out", "static" }
  10. stages = "slide",
  11. ---@usage timeout for notifications in ms, default 5000
  12. timeout = 5000,
  13. ---@usage highlight behind the window for stages that change opacity
  14. background_colour = pallete.fg,
  15. ---@usage Icons for the different levels
  16. icons = {
  17. ERROR = "",
  18. WARN = "",
  19. INFO = "",
  20. DEBUG = "",
  21. TRACE = "✎",
  22. },
  23. },
  24. }
  25. end
  26. M.params_injecter = function(_, entry)
  27. -- FIXME: this is currently getting ignored or is not passed correctly
  28. for key, value in pairs(lvim.builtin.notify.opts) do
  29. entry[key] = value
  30. end
  31. return entry
  32. end
  33. M.default_namer = function(logger, entry)
  34. entry["title"] = logger.name
  35. return entry
  36. end
  37. return M