8000 fix: coderd: dev mode should show verbose output by default (#1898) · coder/coder@1e65a00 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1e65a00

Browse files
johnstcnkylecarbs
authored andcommitted
fix: coderd: dev mode should show verbose output by default (#1898)
< 8000 span class="ws-pre-wrap extended-commit-description-container f6 wb-break-word text-mono mt-2 prc-Text-Text-0ima0">* check buildinfo for devel prerelease tag and show verbose output if so
1 parent 3c27fdb commit 1e65a00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli/server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"path/filepath"
2020
"time"
2121

22+
"github.com/coder/coder/buildinfo"
2223
"github.com/coder/coder/provisioner/echo"
2324

2425
"github.com/briandowns/spinner"
@@ -29,6 +30,7 @@ import (
2930
"github.com/prometheus/client_golang/prometheus/promhttp"
3031
"github.com/spf13/cobra"
3132
sdktrace "go.opentelemetry.io/otel/sdk/trace"
33+
"golang.org/x/mod/semver"
3234
"golang.org/x/oauth2"
3335
xgithub "golang.org/x/oauth2/github"
3436
"golang.org/x/xerrors"
@@ -98,7 +100,8 @@ func server() *cobra.Command {
98100
Short: "Start a Coder server",
99101
RunE: func(cmd *cobra.Command, args []string) error {
100102
logger := slog.Make(sloghuman.Sink(os.Stderr))
101-
if verbose {
103+
buildModeDev := semver.Prerelease(buildinfo.Version()) == "-devel"
104+
if verbose || buildModeDev {
102105
logger = logger.Leveled(slog.LevelDebug)
103106
}
104107

0 commit comments

Comments
 (0)
0