Skip to content

Commit

Permalink
Merge branch 'main' into show-source
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW authored May 11, 2023
2 parents a33ee6b + 69c8184 commit 34c1c31
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ func Execute() {
}

func setLogger(verbose bool) {
logger := slog.New(slog.NewTextHandler(io.Discard))
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
switch {
case os.Getenv("DEBUG") != "" || os.Getenv("ACTIONS_STEP_DEBUG") != "":
logger = slog.New(slog.HandlerOptions{
logger = slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{
AddSource: true,
Level: slog.LevelDebug,
}.NewTextHandler(os.Stderr))
}))
case verbose:
logger = slog.New(slog.HandlerOptions{
logger = slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{
AddSource: false,
Level: slog.LevelInfo,
}.NewTextHandler(os.Stderr))
}))
}
slog.SetDefault(logger)
}
Expand Down

0 comments on commit 34c1c31

Please sign in to comment.