mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 15:40:04 +08:00
21 lines
380 B
Lua
21 lines
380 B
Lua
|
local debug = {}
|
||
|
|
||
|
debug.flag = false
|
||
|
|
||
|
---Print log
|
||
|
---@vararg any
|
||
|
debug.log = function(...)
|
||
|
if debug.flag then
|
||
|
local data = {}
|
||
|
for _, v in ipairs({ ... }) do
|
||
|
if not vim.tbl_contains({ 'string', 'number', 'boolean' }, type(v)) then
|
||
|
v = vim.inspect(v)
|
||
|
end
|
||
|
table.insert(data, v)
|
||
|
end
|
||
|
print(table.concat(data, '\t'))
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return debug
|