Skip to content

Commit

Permalink
fix: coderd: dev mode should show verbose output by default (#1898)
Browse files Browse the repository at this point in the history
* check buildinfo for devel prerelease tag and show verbose output if so
  • Loading branch information
johnstcn committed Jun 1, 2022
1 parent 7acb742 commit 7b40c69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"path/filepath"
"time"

"github.com/coder/coder/buildinfo"
"github.com/coder/coder/provisioner/echo"

"github.com/briandowns/spinner"
Expand All @@ -29,6 +30,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/cobra"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"golang.org/x/mod/semver"
"golang.org/x/oauth2"
xgithub "golang.org/x/oauth2/github"
"golang.org/x/xerrors"
Expand Down Expand Up @@ -98,7 +100,8 @@ func server() *cobra.Command {
Short: "Start a Coder server",
RunE: func(cmd *cobra.Command, args []string) error {
logger := slog.Make(sloghuman.Sink(os.Stderr))
if verbose {
buildModeDev := semver.Prerelease(buildinfo.Version()) == "-devel"
if verbose || buildModeDev {
logger = logger.Leveled(slog.LevelDebug)
}

Expand Down

0 comments on commit 7b40c69

Please sign in to comment.