summaryrefslogtreecommitdiff
path: root/lua/lvim/core
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-04-12 11:18:17 +0200
committerGitHub <[email protected]>2022-04-12 11:18:17 +0200
commit1569202d39c40d7a44de5eb1b10cf203dd33af41 (patch)
treef44862786fe8d39e5f7cd2ec7d0c101b27bc68ba /lua/lvim/core
parent3de6a404c92e495baa8688aa76d98c4ea9caa8c7 (diff)
fix(impatient): avoid get_options in fast handler (#2451)
Diffstat (limited to 'lua/lvim/core')
-rw-r--r--lua/lvim/core/log.lua6
1 files changed, 2 insertions, 4 deletions
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