refactor(log): some types
This commit is contained in:
parent
5ea71be825
commit
a0cda75dd5
2 changed files with 7 additions and 6 deletions
|
|
@ -16,10 +16,6 @@ local c = require "gopher.config"
|
||||||
---@field error fun(...)
|
---@field error fun(...)
|
||||||
---@field fmt_error fun(...)
|
---@field fmt_error fun(...)
|
||||||
|
|
||||||
---@type Gopher.Logger
|
|
||||||
---@diagnostic disable-next-line: missing-fields
|
|
||||||
local log = {}
|
|
||||||
|
|
||||||
local config = {
|
local config = {
|
||||||
-- Name of the plugin. Prepended to log messages
|
-- Name of the plugin. Prepended to log messages
|
||||||
name = c.___plugin_name,
|
name = c.___plugin_name,
|
||||||
|
|
@ -49,6 +45,12 @@ local config = {
|
||||||
-- Can limit the number of decimals displayed for floats
|
-- Can limit the number of decimals displayed for floats
|
||||||
float_precision = 0.01,
|
float_precision = 0.01,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---@type Gopher.Logger
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
local log = {}
|
||||||
|
|
||||||
|
---@return string
|
||||||
function log.get_outfile()
|
function log.get_outfile()
|
||||||
return table.concat {
|
return table.concat {
|
||||||
(vim.fn.has "nvim-0.8.0" == 1) and vim.fn.stdpath "log" or vim.fn.stdpath "cache",
|
(vim.fn.has "nvim-0.8.0" == 1) and vim.fn.stdpath "log" or vim.fn.stdpath "cache",
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,8 @@ local gopher = {}
|
||||||
---@usage `require("gopher").setup {}` (replace `{}` with your `config` table)
|
---@usage `require("gopher").setup {}` (replace `{}` with your `config` table)
|
||||||
gopher.setup = function(user_config)
|
gopher.setup = function(user_config)
|
||||||
log.debug "setting up config"
|
log.debug "setting up config"
|
||||||
log.debug(vim.inspect(user_config))
|
|
||||||
|
|
||||||
require("gopher.config").setup(user_config)
|
require("gopher.config").setup(user_config)
|
||||||
|
log.debug(vim.inspect(user_config))
|
||||||
end
|
end
|
||||||
|
|
||||||
---@toc_entry Install dependencies
|
---@toc_entry Install dependencies
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue