mirror of
https://github.com/neovim/neovim
synced 2025-07-17 17:51:48 +00:00
feat(lsp): add warning message for large log size
This commit is contained in:
@ -32,6 +32,17 @@ do
|
|||||||
|
|
||||||
vim.fn.mkdir(vim.fn.stdpath('cache'), "p")
|
vim.fn.mkdir(vim.fn.stdpath('cache'), "p")
|
||||||
local logfile = assert(io.open(logfilename, "a+"))
|
local logfile = assert(io.open(logfilename, "a+"))
|
||||||
|
|
||||||
|
local log_info = vim.loop.fs_stat(logfilename)
|
||||||
|
if log_info and log_info.size > 1e9 then
|
||||||
|
local warn_msg = string.format(
|
||||||
|
"LSP client log is large (%d MB): %s",
|
||||||
|
log_info.size / (1000 * 1000),
|
||||||
|
logfilename
|
||||||
|
)
|
||||||
|
vim.notify(warn_msg)
|
||||||
|
end
|
||||||
|
|
||||||
-- Start message for logging
|
-- Start message for logging
|
||||||
logfile:write(string.format("[ START ] %s ] LSP logging initiated\n", os.date(log_date_format)))
|
logfile:write(string.format("[ START ] %s ] LSP logging initiated\n", os.date(log_date_format)))
|
||||||
for level, levelnr in pairs(log.levels) do
|
for level, levelnr in pairs(log.levels) do
|
||||||
|
Reference in New Issue
Block a user