Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log fixes #35

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/qvim/lang/dap/filetypes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local M = {}

local shared_util = require("qvim.lang.utils")

local log = require("qvim.log").lsp
local log = require("qvim.log").dap
local fmt = string.format

local req_path = "qvim.lang.dap.filetypes."
Expand Down
2 changes: 1 addition & 1 deletion lua/qvim/lang/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---@class lang
local M = {}
local utils = require("qvim.utils")
local autocmds = require "qvim.core.autocmds"
local autocmds = require("qvim.core.autocmds")

function M.setup()
if not utils.is_directory(qvim.lsp.templates_dir) then
Expand Down
12 changes: 6 additions & 6 deletions lua/qvim/lang/templates.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
local M = {}

local Log = require "qvim.log"
local utils = require "qvim.utils"
local lang_utils = require "qvim.lang.utils"
local log = require("qvim.log").qvim
local utils = require("qvim.utils")
local lang_utils = require("qvim.lang.utils")

local ftplugin_dir = qvim.lsp.templates_dir
local fmt = string.format
Expand Down Expand Up @@ -81,7 +81,7 @@ end
function M.generate_templates(filetype_server_map)
filetype_server_map = filetype_server_map
or lang_utils.get_all_supported_filetypes_to_servers()
Log:debug "Templates installation in progress"
log.debug("Templates installation in progress")

M.remove_template_files()

Expand All @@ -96,10 +96,10 @@ function M.generate_templates(filetype_server_map)
lang_utils.select_language_server(ft, servers)
M.generate_ftplugin(ft, selected_server, ftplugin_dir)
else
Log:debug(fmt("Skipped filetype generation for filetype '%s'.", ft))
log.debug(fmt("Skipped filetype generation for filetype '%s'.", ft))
end
end
Log:debug "Templates installation is complete"
log.debug("Templates installation is complete")
end

return M
10 changes: 5 additions & 5 deletions lua/qvim/lang/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---@field get_all_supported_filetypes_to_servers function
---@field select_language_server function
local M = {}
local Log = require "qvim.log"
local log = require("qvim.log").qvim
local fmt = string.format

---Get a proxy table that maps filetypes to there specific ft file.
Expand Down Expand Up @@ -70,7 +70,7 @@ function M.try_install_and_setup_mason_package(package, scope, setup, args)
---@field name string

if not package:is_installed() then
Log:debug(
log.debug(
fmt(
"Automatically installing '%s' by the mason package '%s'.",
scope,
Expand All @@ -80,7 +80,7 @@ function M.try_install_and_setup_mason_package(package, scope, setup, args)
package:install():once("closed", function()
vim.schedule(function()
if package:is_installed() then
Log:info(
log.info(
fmt(
"Installed '%s' by the mason package '%s'.",
scope,
Expand All @@ -89,7 +89,7 @@ function M.try_install_and_setup_mason_package(package, scope, setup, args)
)
setup(unpack(args))
else
Log:warn(
log.warn(
fmt(
"Installation of '%s' by the mason package '%s' failed. Consult mason logs.",
scope,
Expand Down Expand Up @@ -117,7 +117,7 @@ function M.register_custom_mason_package(require_name, require_path)
local _ok, source_package_spec =
pcall(require, require_path .. "." .. require_name)
if _ok then
Log:debug(
log.debug(
fmt(
"A custom mason package '%s' was instanciated from the source '%s' that will be used for installation. Module was: '%s'.",
source_package_spec.name,
Expand Down
Loading