diff --git a/internal/lsp/cmd/cmd.go b/internal/lsp/cmd/cmd.go index e4a8da53..f1baea7d 100644 --- a/internal/lsp/cmd/cmd.go +++ b/internal/lsp/cmd/cmd.go @@ -47,6 +47,9 @@ type Application struct { // Support for remote lsp server Remote string `flag:"remote" help:"*EXPERIMENTAL* - forward all commands to a remote lsp"` + + // Enable verbose logging + Verbose bool `flag:"v" help:"Verbose output"` } // Name implements tool.Application returning the binary name. @@ -225,11 +228,17 @@ func (c *cmdClient) LogMessage(ctx context.Context, p *protocol.LogMessageParams case protocol.Warning: log.Print("Warning:", p.Message) case protocol.Info: - log.Print("Info:", p.Message) + if c.app.Verbose { + log.Print("Info:", p.Message) + } case protocol.Log: - log.Print("Log:", p.Message) + if c.app.Verbose { + log.Print("Log:", p.Message) + } default: - log.Print(p.Message) + if c.app.Verbose { + log.Print(p.Message) + } } return nil }