refactor(logger): add some type annotations

This commit is contained in:
Smirnov Oleksandr 2024-04-17 01:56:56 +03:00
parent c43b33cb60
commit 517150e5c2

View file

@ -33,6 +33,21 @@ local config = {
float_precision = 0.01, float_precision = 0.01,
} }
---@class Gopher.Logger
---@field outfile string
---@field trace fun(...)
---@field fmt_trace fun(...)
---@field debug fun(...)
---@field fmt_debug fun(...)
---@field info fun(...)
---@field fmt_info fun(...)
---@field warn fun(...)
---@field fmt_warn fun(...)
---@field error fun(...)
---@field fmt_error fun(...)
---@type Gopher.Logger
---@diagnostic disable-next-line: missing-fields
local log = { local log = {
outfile = table.concat { outfile = 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",