···11+local M = {}
22+33+function M.verbose_logger(namespace)
44+ --- Print a message to the user if verbose mode is enabled.
55+ ---@param msg string|table The message to print.
66+ ---@param label string|nil An optional label to include in the message.
77+ local function verbose(msg, label)
88+ label = label or debug.getinfo(3, "n").name
99+ if vim.o.verbose ~= 0 then
1010+ local l = label and ":" .. label or ""
1111+ if type(msg) == "string" then
1212+ print("[" .. namespace .. l .. "] " .. msg)
1313+ else
1414+ print("[" .. namespace .. l .. "] " .. vim.inspect(msg))
1515+ end
1616+ end
1717+ end
1818+ return verbose
1919+end
2020+2121+M.vclib_verbose = M.verbose_logger("vclib")
2222+2323+return M