fix(util): use correct log calls
This commit is contained in:
+6
-4
@@ -1,3 +1,5 @@
|
|||||||
|
local log = require("ow.log")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.os_name = vim.uv.os_uname().sysname
|
M.os_name = vim.uv.os_uname().sysname
|
||||||
@@ -107,7 +109,7 @@ function M.try_require(module)
|
|||||||
return resp
|
return resp
|
||||||
end
|
end
|
||||||
|
|
||||||
M.err(("Failed to load module %s:\n%s"):format(module, resp))
|
log.error("Failed to load module %s:\n%s", module, resp)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Checks if it is possible to require a module
|
--- Checks if it is possible to require a module
|
||||||
@@ -158,7 +160,7 @@ function M.format(opts)
|
|||||||
and opts.output ~= "stderr"
|
and opts.output ~= "stderr"
|
||||||
and opts.output ~= "in_place"
|
and opts.output ~= "in_place"
|
||||||
then
|
then
|
||||||
M.err(
|
log.error(
|
||||||
"`output` must be set to either `stdout`, `stderr` or `in_place`."
|
"`output` must be set to either `stdout`, `stderr` or `in_place`."
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
@@ -248,7 +250,7 @@ function M.format(opts)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if err then
|
if err then
|
||||||
M.err("Error during formatting:\n%s" .. err)
|
log.error("Error during formatting:\n%s", err)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -261,7 +263,7 @@ function M.format(opts)
|
|||||||
msg = ":\n" .. stderr
|
msg = ":\n" .. stderr
|
||||||
end
|
end
|
||||||
|
|
||||||
M.err(("Failed to format (%d)%s"):format(resp.code, msg))
|
log.error("Failed to format (%d)%s", resp.code, msg)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user