Skip to content

Commit

Permalink
feat(init): better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jghauser committed Jul 27, 2024
1 parent 234c82d commit 9a99488
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/papis/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ function M.start()
end

-- setup commands
log.debug("Setting up commands")
require("papis.commands").setup()

-- setup enabled modules
for module_name, _ in pairs(config.enable_modules) do
log.trace(module_name .. " is enabled")
log.debug(module_name .. " is enabled")
local has_module, module = pcall(require, "papis." .. module_name)
if has_module then
if module.setup then
Expand All @@ -95,20 +96,22 @@ function M.start()
end

-- setup keymaps
log.debug("Setting up keymaps")
require("papis.keymaps"):setup()

-- check if other neovim instances has file watchers
local does_pid_exist = require("papis.utils").does_pid_exist
if not does_pid_exist(db.state:get_fw_running()) then
-- setup file watchers because no other neovim instance has them
if config.enable_fs_watcher then
log.debug("Setting up file watchers")
require("papis.fs-watcher"):init()
end

-- only synchronise the data table if it's not empty
-- (in that case, we tell users to manually do it because it takes a while)
if not db.data:empty() then
log.debug("Synchronising the database")
log.debug("Setting up/syncrhonising the database")
data:sync_db()
end
else
Expand Down

0 comments on commit 9a99488

Please sign in to comment.