Skip to content

Commit 5494320

Browse files
committed
update log path to stdpath('log')
1 parent ef44ba4 commit 5494320

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lua/guihua/log.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ log.new = function(config, standalone)
8080
config = vim.tbl_deep_extend('force', default_config, config)
8181
-- path ~/.local/share/nvim
8282

83-
local cache_dir = vim.fn.stdpath('cache') -- ' stdpath('log') '
83+
local log_dir = vim.fn.stdpath('log')
8484
config.log_file = config.log_file or config.plugin or 'gh'
85-
local outfile = string.format('%s%s%s.log', cache_dir, sep(), config.log_file)
85+
local outfile = string.format('%s%s%s.log', log_dir, sep(), config.log_file)
8686

8787
if config.use_file then
8888
local fp = io.open(outfile, 'r')
@@ -144,8 +144,7 @@ log.new = function(config, standalone)
144144

145145
-- Output to console
146146
if config.use_console then
147-
local console_string =
148-
string.format('[%-4s][%s] %s: %s', nameupper, os.date('%H:%M:%S'), lineinfo, msg)
147+
local console_string = string.format('[%-4s][%s] %s: %s', nameupper, os.date('%H:%M:%S'), lineinfo, msg)
149148

150149
if config.highlights and level_config.hl then
151150
vim.cmd(string.format('echohl %s', level_config.hl))

0 commit comments

Comments
 (0)