Skip to content

Guide: How to view ZLS log output

Techatrix edited this page Jul 23, 2024 · 6 revisions

Tip

A non-debug build of ZLS will report info, warn and error log messages.

It is recommended to building from source without -Doptimize to include more verbose log messages.

zls.log (since ZLS 0.14.0-dev.50+3354fdcb)

Run zls env and then look for the log_file property:

{
 "version": "0.14.0-dev.50+3354fdcb",
 "global_cache_dir": "/home/anon/.cache/zls",
 "global_config_dir": "/etc/xdg",
 "local_config_dir": "/home/anon/.config",
 "config_file": null,
 "log_file": "/home/anon/.cache/zls/zls.log"
}

The logs can then be found in /home/anon/.cache/zls/zls.log. Please note that ZLS will not empty the file when restarting but always append logs instead.

Use Editor logs

Code Editor Instructions Notes
Visual Studio Code Bottom Panel -> Output -> Zig Language Server requires the ziglang.vscode-zig extension
Sublime Text LSP: Toggle Log Panel requires the LSP package
JetBrains IDE with ZigBrains Start the editor through the terminal
Helix Open the helix log file. [:log-open]
nvim-lspconfig :LspLog nvim-lspconfig Troubleshooting
NeoVim/Vim with CoC :CocCommand workspace.showOutput CoC Debug language server
Emacs with LSP-Mode lsp-workspace-show-log LSP Mode Troubleshooting
Kate Bottom Sidebar -> Output

If your code editor or extension is not included in the above table, feel free to open an issue about it or edit this page directly.

Clone this wiki locally