Skip to content

Commit e9b1d87

Browse files
authored
fix(log): Use stdpath('log') (#607)
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.
1 parent 37604d9 commit e9b1d87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/plenary/log.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ local default_config = {
2727
highlights = true,
2828

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

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

8282
local outfile = vim.F.if_nil(
8383
config.outfile,
84-
Path:new(vim.api.nvim_call_function("stdpath", { "cache" }), config.plugin .. ".log").filename
84+
Path:new(vim.api.nvim_call_function("stdpath", { "log" }), config.plugin .. ".log").filename
8585
)
8686

8787
local obj

0 commit comments

Comments
 (0)