Skip to content

Commit 33812a6

Browse files
feat: add logging to file (#166)
* feat: add logging to file * chore: update README and auto-generate vimdoc * chore: fmt * chore: default log path to stdpath('log') * chore: support logger.trace * chore: update README and auto-generate vimdoc * chore: don't notify about debug and trace * chore: add uuid to log msgs to differentiate neovim instances --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent acf18d8 commit 33812a6

File tree

5 files changed

+151
-94
lines changed

5 files changed

+151
-94
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Voice commands (`:GpWhisper*`) depend on `SoX` (Sound eXchange) to handle audio
210210
Below is a linked snippet with the default values, but I suggest starting with minimal config possible (just `openai_api_key` if you don't have `OPENAI_API_KEY` env set up). Defaults change over time to improve things, options might get deprecated and so on - it's better to change only things where the default doesn't fit your needs.
211211

212212
<!-- README_REFERENCE_MARKER_REPLACE_NEXT_LINE -->
213-
https://github.com/Robitx/gp.nvim/blob/a062dbea91340fc6423fd06b6c3f84f252ba8f38/lua/gp/config.lua#L9-L565
213+
https://github.com/Robitx/gp.nvim/blob/475c9771fdef9a90f0a90fcb6b824736cec671f1/lua/gp/config.lua#L9-L568
214214

215215
# Usage
216216

doc/gp.nvim.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ options might get deprecated and so on - it’s better to change only things
252252
where the default doesn’t fit your needs.
253253

254254

255-
https://github.com/Robitx/gp.nvim/blob/a062dbea91340fc6423fd06b6c3f84f252ba8f38/lua/gp/config.lua#L9-L565
255+
https://github.com/Robitx/gp.nvim/blob/475c9771fdef9a90f0a90fcb6b824736cec671f1/lua/gp/config.lua#L9-L568
256256

257257

258258
==============================================================================

lua/gp/config.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ local config = {
7777
-- curl_params = { "--proxy", "http://X.X.X.X:XXXX" }
7878
curl_params = {},
7979

80+
-- log file location
81+
log_file = vim.fn.stdpath("log"):gsub("/$", "") .. "/gp.nvim.log",
82+
8083
-- directory for persisting state dynamically changed by user (like model or persona)
8184
state_dir = vim.fn.stdpath("data"):gsub("/$", "") .. "/gp/persisted",
8285

@@ -512,7 +515,7 @@ local config = {
512515
.. "\n\nRespond exclusively with the snippet that should replace the selection above."
513516

514517
local agent = gp.get_command_agent()
515-
gp.info("Implementing selection with agent: " .. agent.name)
518+
gp.logger.info("Implementing selection with agent: " .. agent.name)
516519

517520
gp.Prompt(
518521
params,

0 commit comments

Comments
 (0)