From bcc0c7c87b48d216608ba55c8ac8347ff27d1ccf Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Tue, 2 Jul 2024 22:01:26 +0300 Subject: [PATCH] fix: not being able to disable writing DEBUG logs This bug caused useless log lines to be written to the log file. If you want to delete your log file, you can find it with `:checkhealth yazi` --- lua/yazi/log.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/yazi/log.lua b/lua/yazi/log.lua index dcd844bf..4f6f73d1 100644 --- a/lua/yazi/log.lua +++ b/lua/yazi/log.lua @@ -58,7 +58,12 @@ end ---@param message string function Log:debug(message) - if self.level and self.level >= log_levels.DEBUG then + vim.notify(vim.inspect({ self.level })) + if + self.level + and self.level ~= log_levels.OFF + and self.level <= log_levels.DEBUG + then self:write_message('DEBUG', message) end end