From 1569202d39c40d7a44de5eb1b10cf203dd33af41 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Tue, 12 Apr 2022 11:18:17 +0200 Subject: fix(impatient): avoid get_options in fast handler (#2451) --- lua/lvim/core/log.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lua/lvim/core/log.lua') diff --git a/lua/lvim/core/log.lua b/lua/lvim/core/log.lua index d0e74f18..15ccb11c 100644 --- a/lua/lvim/core/log.lua +++ b/lua/lvim/core/log.lua @@ -1,7 +1,5 @@ local Log = {} -local logfile = string.format("%s/%s.log", get_cache_dir(), "lvim") - Log.levels = { TRACE = 1, DEBUG = 2, @@ -39,7 +37,7 @@ function Log:init() { level = structlog.formatters.FormatColorizer.color_level() } ), }), - structlog.sinks.File(log_level, logfile, { + structlog.sinks.File(log_level, self:get_path(), { processors = { structlog.processors.Namer(), structlog.processors.StackWriter({ "line", "file" }, { max_parents = 3, stack_level = 2 }), @@ -155,7 +153,7 @@ end ---Retrieves the path of the logfile ---@return string path of the logfile function Log:get_path() - return logfile + return string.format("%s/%s.log", get_cache_dir(), "lvim") end ---Add a log entry at TRACE level -- cgit v1.2.3