From d67042b868567e07dc828ca72b2cb257b6059b8e Mon Sep 17 00:00:00 2001 From: phosphene47 Date: Mon, 13 Dec 2021 19:02:32 +1100 Subject: Print to stderr instead of normal echo if log message is of type error --- lua/dep/log.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lua/dep/log.lua b/lua/dep/log.lua index d719772..7ed32ee 100755 --- a/lua/dep/log.lua +++ b/lua/dep/log.lua @@ -43,11 +43,15 @@ function logger:log(op, message) end if not self.silent and colors[op] then - vim.api.nvim_echo({ - { "[dep]", "Identifier" }, - { " " }, - { message, colors[op] }, - }, true, {}) + 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 -- cgit v1.2.1