Closed AlejandroSuero closed 2 weeks ago
Hey @sm-victorw, if you could take a look at this PR to potentially move it forward it would be amazing since it solves both #42 and #4 (which are both small but annoying quirks).
Sorry for the bump but it was in hopes you had custom notifications and this wasn't on your backlog.
Appreciate your time.
@AlejandroSuero would it be possible to have the verbosity for the logger controlled through a single config option, particularly log_level
? Having 3 separate boolean values to control what get printed feels rather unintuitive.
I have in mind that e.g. log_level
taking values "off", "silent", "warn", or "debug" or something similar would be more manageable
@sm-victorw I made the changes so now it just needs to be
-- supermaven opts
{
keymaps = {
-- ...
},
log_level = "off" -- based on `vim.log.levels[log_level:upper()]`
}
if off
silence all expect warnings and errors.
Changes made
logger
inspired by none-ls but without the use of plenary.nvim.logger
with the level warning.README
.Demo of the changes
silence_info
anddebug
on:https://github.com/supermaven-inc/supermaven-nvim/assets/71392160/0be8797b-d6fa-4cb2-b6bd-beae5c57539b
silence_info
anddebug
off:https://github.com/supermaven-inc/supermaven-nvim/assets/71392160/d3300bde-9a8d-420d-9dd3-3a85187f479a
How to use the logger
local log = require("supermaven-nvim.logger")
.print
)debug
is true.silence_info
is true.log_level
option is set too"off"
.debug = true
or/and silenced info,:SupermavenShowLog
to show the log file with timestamps and the level off error.:SupermavenClearLog
.Closes #18 Closes #42