Skip to content

Commit 8d667d8

Browse files
blink-so[bot]ThomasK33
andcommitted
refactor: unify logging by using logger module instead of vim.notify
- Replace all vim.notify calls with appropriate logger.* calls for consistency - Remove redundant notifications where logger already handles the logging - Maintain unified logging throughout the project - Better adherence to project's logging standards Co-authored-by: ThomasK33 <[email protected]>
1 parent 66f18f9 commit 8d667d8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lua/claudecode/init.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,11 @@ function M._create_commands()
262262

263263
if error then
264264
logger.warn("command", "ClaudeCodeSend->TreeAdd: " .. error)
265-
vim.notify(error, vim.log.levels.WARN, { title = "ClaudeCode" })
266265
return
267266
end
268267

269268
if not files or #files == 0 then
270269
logger.warn("command", "ClaudeCodeSend->TreeAdd: No files selected")
271-
vim.notify("No files selected", vim.log.levels.WARN, { title = "ClaudeCode" })
272270
return
273271
end
274272

@@ -295,7 +293,7 @@ function M._create_commands()
295293
or string.format("Added %d files to Claude context", success_count)
296294
logger.debug("command", message) -- Use debug level to avoid popup
297295
else
298-
vim.notify("Failed to add any files", vim.log.levels.ERROR, { title = "ClaudeCode" })
296+
logger.error("command", "ClaudeCodeSend->TreeAdd: Failed to add any files")
299297
end
300298

301299
-- Exit visual mode if we were in it
@@ -315,7 +313,6 @@ function M._create_commands()
315313

316314
if not M.state.server then
317315
logger.error("command", "ClaudeCodeSend: Claude Code integration is not running.")
318-
vim.notify("Claude Code integration is not running", vim.log.levels.ERROR, { title = "ClaudeCode Error" })
319316
return
320317
end
321318

@@ -356,13 +353,11 @@ function M._create_commands()
356353

357354
if error then
358355
logger.warn("command", "ClaudeCodeTreeAdd: " .. error)
359-
vim.notify(error, vim.log.levels.WARN, { title = "ClaudeCode" })
360356
return
361357
end
362358

363359
if not files or #files == 0 then
364360
logger.warn("command", "ClaudeCodeTreeAdd: No files selected")
365-
vim.notify("No files selected", vim.log.levels.WARN, { title = "ClaudeCode" })
366361
return
367362
end
368363

@@ -387,9 +382,9 @@ function M._create_commands()
387382
if success_count > 0 then
388383
local message = success_count == 1 and "Added 1 file to Claude context"
389384
or string.format("Added %d files to Claude context", success_count)
390-
vim.notify(message, vim.log.levels.DEBUG, { title = "ClaudeCode" })
385+
logger.debug("command", message)
391386
else
392-
vim.notify("Failed to add any files", vim.log.levels.ERROR, { title = "ClaudeCode" })
387+
logger.error("command", "ClaudeCodeTreeAdd: Failed to add any files")
393388
end
394389
end, {
395390
desc = "Add selected file(s) from tree explorer to Claude Code context",

0 commit comments

Comments
 (0)