change log level

pull/4/head
ray-x 3 years ago
parent 09e5196049
commit e2bf480d22

@ -4,6 +4,7 @@ local TextView = require "guihua.textview"
local View = require "guihua.view"
local util = require "navigator.util"
local log = require "navigator.util".log
local verbose = require "navigator.util".verbose
function M.new_preview(opts)
return TextView:new(
@ -44,10 +45,9 @@ function M._preview_location(location, width, pos_x, pos_y)
syntax = api.nvim_buf_get_option(bufnr, "ft")
end
log(syntax, contents)
verbose(syntax, contents)
local opts = {syntax = syntax, width = width, pos_x = pos_x or 0, pos_y = pos_y or 10}
opts.items = contents
log("syntax", opts.syntax)
return M.new_preview(opts)
end
@ -58,7 +58,7 @@ end
--
function M.preview_file(filename, width, line, col, offset_x, offset_y)
log("file", filename, line, offset_x, offset_y)
verbose("file", filename, line, offset_x, offset_y)
if line >= 2 then
line = line - 2
end
@ -70,7 +70,7 @@ function M.preview_file(filename, width, line, col, offset_x, offset_y)
end
function M.preview_uri(uri, width, line, col, offset_x, offset_y)
log("uri", uri, line, offset_x, offset_y)
verbose("uri", uri, line, offset_x, offset_y)
if line >= 2 then
line = line - 2
end
@ -133,7 +133,7 @@ function M.new_list_view(opts)
pos = 1
end
local l = data[pos]
log("on move", pos, l.text or l, l.uri, l.filename)
verbose("on move", pos, l.text or l, l.uri, l.filename)
-- todo fix
if l.uri ~= nil then
return M.preview_uri(l.uri, width, l.lnum, l.col, 0, offset_y)

@ -1,7 +1,7 @@
local util = require "navigator.util"
local lsphelper = require "navigator.lspwrapper"
local gui = require "navigator.gui"
local log = require "navigator.util".log
local verbose = require "navigator.util".verbose
-- local log = util.log
-- local partial = util.partial
-- local cwd = vim.fn.getcwd(0)
@ -24,7 +24,7 @@ local function ref_hdlr(arg1, api, locations, num, bufnr)
print "References not found"
return
end
log(locations)
verbose(locations)
local items = locations_to_items(locations)
gui.new_list_view({items = items, api = 'Reference'})
end

@ -96,7 +96,7 @@ local default_config = {
level = "info"
}
M._log = require('guihua.log').new({level='debug'}, true)
M._log = require('guihua.log').new({level='info'}, true)
-- add log to you lsp.log
M.log = M._log.info

Loading…
Cancel
Save