Skip to content

Commit

Permalink
lsp: Make verbose logging configurable (#623)
Browse files Browse the repository at this point in the history
Setting --verbose will now be required to see request responses from the
server.

Signed-off-by: Charlie Egan <charlie@styra.com>
  • Loading branch information
charlieegan3 authored Apr 8, 2024
1 parent 4d7cbe1 commit 6df97b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/languageserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
)

func init() {
verboseLogging := false

languageServerCommand := &cobra.Command{
Use: "language-server",
Short: "Run the Regal Language Server",
Expand All @@ -25,7 +27,7 @@ func init() {

opts := &lsp.LanguageServerOptions{
ErrorLog: os.Stderr,
VerboseLogging: true,
VerboseLogging: verboseLogging,
}

ls := lsp.NewLanguageServer(opts)
Expand Down Expand Up @@ -54,5 +56,7 @@ func init() {
}),
}

languageServerCommand.Flags().BoolVarP(&verboseLogging, "verbose", "v", verboseLogging, "Enable verbose logging")

RootCommand.AddCommand(languageServerCommand)
}

0 comments on commit 6df97b3

Please sign in to comment.