Skip to content

Commit

Permalink
feat: add plugin name to logger (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 authored Jul 5, 2023
1 parent fc06593 commit 9927cb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/gitlinker/logger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ local function log(level, msg)
if Config.console then
vim.cmd("echohl " .. EchoHl[level])
for _, line in ipairs(msg_lines) do
vim.cmd(string.format('echom "%s"', vim.fn.escape(line, '"')))
vim.cmd(
string.format('echom "[gitlinker.nvim] %s"', vim.fn.escape(line, '"'))
)
end
vim.cmd("echohl None")
end
Expand All @@ -38,7 +40,7 @@ local function log(level, msg)
for _, line in ipairs(msg_lines) do
fp:write(
string.format(
"%s [%s] - %s\n",
"[gitlinker.nvim] %s [%s] - %s\n",
os.date("%Y-%m-%d %H:%M:%S"),
level,
line
Expand Down

0 comments on commit 9927cb6

Please sign in to comment.