Skip to content

Commit cc6bcda

Browse files
committed
perf(#3257): inline require log notify
1 parent bb845a6 commit cc6bcda

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lua/nvim-tree.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ function M.setup(config_user)
281281

282282
manage_netrw()
283283

284-
require("nvim-tree.log").start()
284+
log.start()
285285

286286
if log.enabled("config") then
287287
log.line("config", "default config + user")

lua/nvim-tree/log.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ function M.start()
120120
if config.g.log.truncate then
121121
os.remove(file_path)
122122
end
123-
require("nvim-tree.notify").debug("nvim-tree.lua logging to " .. file_path)
123+
if config.g.notify.threshold <= vim.log.levels.DEBUG then
124+
require("nvim-tree.notify").debug("nvim-tree.lua logging to " .. file_path)
125+
end
124126
end
125127
end
126128

0 commit comments

Comments
 (0)