Print to stderr instead of normal echo if log message is of type error

This commit is contained in:
phosphene47
2021-12-13 19:02:32 +11:00
parent 7c03a8a2bd
commit d67042b868

View File

@ -43,12 +43,16 @@ function logger:log(op, message)
end
if not self.silent and colors[op] then
if op == "error" then
vim.api.nvim_err_writeln(string.format("[dep] %s", message))
else
vim.api.nvim_echo({
{ "[dep]", "Identifier" },
{ " " },
{ message, colors[op] },
}, true, {})
end
end
if self.pipe then
self.pipe:write(string.format("[%s] %s: %s\n", os.date(), source, message))