Skip to content

Commit

Permalink
fix: not being able to disable writing DEBUG logs (#150)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
mikavilpas authored Jul 2, 2024
1 parent a399150 commit 8f251de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/yazi/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

3 comments on commit 8f251de

@nmrtv
Copy link

@nmrtv nmrtv commented on 8f251de Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the point of vim.notify here? Now I'm getting annoying popup every time I open yazi even when I set log level to OFF.

@mikavilpas
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I just use it for debugging and left it in accidentally. 😄

I will remove it. If you want to make a quick PR that is gone too.

@mikavilpas
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's going to be released now in #154

Please sign in to comment.