vim.lsp.log
Methods11
function M.get_filename() -> log string
Returns the log filename.
logstringfilename
function M.debug(...: any) -> nil | boolean
@nodoc
function M.error(...: any) -> nil | boolean
@nodoc
function M.info(...: any) -> nil | boolean
@nodoc
function M.trace(...: any) -> nil | boolean
@nodoc
function M.warn(...: any) -> nil | boolean
@nodoc
function M.set_level(level: string | integer) -> nil
Sets the current log level.
levelstring | integerOne of |vim.log.levels|
- nil
function M.get_level() -> current integer
Gets the current log level.
currentintegerlog level
function M.set_format_func(handle: fun(level: string, ...) -> nil | string) -> nil
Sets the formatting function used to format logs. If the formatting function returns nil, the entry won't be written to the log file.
handlefun(level: string, ...) -> nil | stringFunction to apply to log entries. The default will log the level, date, source and line number of the caller, followed by the arguments.
- nil
function M.should_log(level: integer) -> boolean
Deprecated
Checks whether the level is sufficient for logging.
levelintegerlog level
- boolean
: true if would log, false if not
function M._from_lsp_level(message_type: lsp.MessageType) -> 4 | 3 | 2 | 1
Convert LSP MessageType to vim.log.levels
Fields2
M.levels : {string, integer} | {integer, string}
Log level dictionary with reverse lookup as well.
Can be used to lookup the number from the name or the name from the number. Levels by name: "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" Level numbers begin with "TRACE" at 0
@nodoc
M._self : vim.Log