Browse Source

fix(config/log): show error in config instead of hiding (#1751)

Chase Colman 3 years ago
parent
commit
9e18c16b2b
2 changed files with 3 additions and 3 deletions
  1. 2 2
      lua/lvim/config/init.lua
  2. 1 1
      lua/lvim/core/log.lua

+ 2 - 2
lua/lvim/config/init.lua

@@ -152,10 +152,10 @@ end
 -- @param config_path The path to the configuration overrides
 function M:load(config_path)
   config_path = config_path or self.get_user_config_path()
-  local ok, _ = pcall(dofile, config_path)
+  local ok, err = pcall(dofile, config_path)
   if not ok then
     if utils.is_file(user_config_file) then
-      Log:warn("Invalid configuration: " .. config_path)
+      Log:warn("Invalid configuration: " .. err)
     else
       Log:warn(string.format("Unable to find configuration file [%s]", config_path))
     end

+ 1 - 1
lua/lvim/core/log.lua

@@ -12,7 +12,7 @@ function Log:add_entry(msg, level)
   end
   local status_ok, plenary = pcall(require, "plenary")
   if status_ok then
-    local default_opts = { plugin = "lunarvim", level = lvim.log.level }
+    local default_opts = { plugin = "lunarvim", level = lvim.log.level, info_level = 4 }
     local handle = plenary.log.new(default_opts)
     handle[level:lower()](msg)
     self.__handle = handle