Skip to content

Commit

Permalink
fix: only log debug messages when data exists
Browse files Browse the repository at this point in the history
Previously debug messages were always logged even with empty data. This change
adds a condition to only log debug messages when data exists and is not empty,
reducing noise in the debug output.
  • Loading branch information
deathbeam committed Dec 1, 2024
1 parent 3b6f193 commit 6c7a687
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/CopilotChat/notify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ M.listeners = {}
---@param data any
function M.publish(event_name, data)
if M.listeners[event_name] then
log.debug(event_name .. ':', data)
if data and data ~= '' then
log.debug(event_name .. ':', data)
end

for _, callback in ipairs(M.listeners[event_name]) do
callback(data)
end
Expand Down

0 comments on commit 6c7a687

Please sign in to comment.