diff options
author | LostNeophyte <[email protected]> | 2022-11-04 15:45:31 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-11-04 15:45:31 +0100 |
commit | 060116eff03f784212c8c6cbc0a6aa0d53d44ad9 (patch) | |
tree | 98f6b56ea972b3025be5bab957f8cb02174cb1c5 /lua/lvim | |
parent | 4841dc62c3505cbe90b17c867bde6bc4d2abbb56 (diff) |
fix(logger): set console logging to sync (#3379)
Diffstat (limited to 'lua/lvim')
-rw-r--r-- | lua/lvim/bootstrap.lua | 14 | ||||
-rw-r--r-- | lua/lvim/config/defaults.lua | 2 | ||||
-rw-r--r-- | lua/lvim/core/log.lua | 3 |
3 files changed, 12 insertions, 7 deletions
diff --git a/lua/lvim/bootstrap.lua b/lua/lvim/bootstrap.lua index 55a22502..3fd000e3 100644 --- a/lua/lvim/bootstrap.lua +++ b/lua/lvim/bootstrap.lua @@ -112,11 +112,15 @@ end ---Update LunarVim ---pulls the latest changes from github and, resets the startup cache function M:update() - reload("lvim.utils.hooks").run_pre_update() - local ret = reload("lvim.utils.git").update_base_lvim() - if ret then - reload("lvim.utils.hooks").run_post_update() - end + require("lvim.core.log"):info "Trying to update LunarVim..." + + vim.schedule(function() + reload("lvim.utils.hooks").run_pre_update() + local ret = reload("lvim.utils.git").update_base_lvim() + if ret then + reload("lvim.utils.hooks").run_post_update() + end + end) end return M diff --git a/lua/lvim/config/defaults.lua b/lua/lvim/config/defaults.lua index 1bd57b94..6a00aaa6 100644 --- a/lua/lvim/config/defaults.lua +++ b/lua/lvim/config/defaults.lua @@ -26,7 +26,7 @@ return { lang = {}, log = { ---@usage can be { "trace", "debug", "info", "warn", "error", "fatal" }, - level = "warn", + level = "info", viewer = { ---@usage this will fallback on "less +F" if not found cmd = "lnav", diff --git a/lua/lvim/core/log.lua b/lua/lvim/core/log.lua index c4f727be..f4ff114a 100644 --- a/lua/lvim/core/log.lua +++ b/lua/lvim/core/log.lua @@ -41,7 +41,7 @@ function Log:init() lvim = { sinks = { structlog.sinks.Console(log_level, { - async = true, + async = false, processors = { structlog.processors.Namer(), structlog.processors.StackWriter({ "line", "file" }, { max_parents = 0, stack_level = 2 }), @@ -68,6 +68,7 @@ function Log:init() }, } + lvim_log.lvim.sinks[1].async = false -- HACK: Bug in structlog prevents setting async to false structlog.configure(lvim_log) local logger = structlog.get_logger "lvim" |