Skip to content

Commit

Permalink
fix: show more logs in ConformInfo when log level is TRACE
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Nov 12, 2023
1 parent e388bd6 commit 0963118
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/conform/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ M.show_window = function()
if vim.fn.filereadable(logfile) == 1 then
local f = io.open(logfile, "r")
if f then
f:seek("end", -1024)
local context = -1024
-- Show more logs if the log level is set to trace.
if log.level == vim.log.levels.TRACE then
context = 3 * context
end
f:seek("end", context)
local text = f:read("*a")
f:close()
local log_lines = vim.split(text, "\n", { plain = true, trimempty = true })
Expand Down

0 comments on commit 0963118

Please sign in to comment.