Skip to content

Commit

Permalink
fix(log): Use stdpath('log') (#607)
Browse files Browse the repository at this point in the history
Neovim has had a standard path for log files since `v0.7.0-322-g78a1e6bc0`, so this should be the preferred location. Logs aren't cache data, so they shouldn't be stored with cache data.

Given that plenary is used in a lot of plugins, this would be a tiny but free improvement in correctness for those plugins.
  • Loading branch information
ZeroKnight authored Feb 11, 2025
1 parent 37604d9 commit e9b1d87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/plenary/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local default_config = {
highlights = true,

-- Should write to a file.
-- Default output for logging file is `stdpath("cache")/plugin`.
-- Default output for logging file is `stdpath("log")/plugin.log`.
use_file = true,

-- Output file has precedence over plugin, if not nil.
Expand Down Expand Up @@ -81,7 +81,7 @@ log.new = function(config, standalone)

local outfile = vim.F.if_nil(
config.outfile,
Path:new(vim.api.nvim_call_function("stdpath", { "cache" }), config.plugin .. ".log").filename
Path:new(vim.api.nvim_call_function("stdpath", { "log" }), config.plugin .. ".log").filename
)

local obj
Expand Down

0 comments on commit e9b1d87

Please sign in to comment.