refactor(log): some types

This commit is contained in:
Smirnov Oleksandr 2024-05-03 21:40:59 +03:00
parent 5ea71be825
commit a0cda75dd5
2 changed files with 7 additions and 6 deletions

View file

@ -16,10 +16,6 @@ local c = require "gopher.config"
---@field error fun(...)
---@field fmt_error fun(...)
---@type Gopher.Logger
---@diagnostic disable-next-line: missing-fields
local log = {}
local config = {
-- Name of the plugin. Prepended to log messages
name = c.___plugin_name,
@ -49,6 +45,12 @@ local config = {
-- Can limit the number of decimals displayed for floats
float_precision = 0.01,
}
---@type Gopher.Logger
---@diagnostic disable-next-line: missing-fields
local log = {}
---@return string
function log.get_outfile()
return table.concat {
(vim.fn.has "nvim-0.8.0" == 1) and vim.fn.stdpath "log" or vim.fn.stdpath "cache",

View file

@ -24,9 +24,8 @@ local gopher = {}
---@usage `require("gopher").setup {}` (replace `{}` with your `config` table)
gopher.setup = function(user_config)
log.debug "setting up config"
log.debug(vim.inspect(user_config))
require("gopher.config").setup(user_config)
log.debug(vim.inspect(user_config))
end
---@toc_entry Install dependencies