Skip to content

Commit

Permalink
chore: debug lines review (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusprubio authored Jun 26, 2024
1 parent 408a3a3 commit 07671a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tasks:

fmt:
summary: "Format the code"
# Runs `go fmt` before finishing.
# Already runs `go fmt` before finishing.
cmd: golines -m 80 --shorten-comments -w .

vet:
Expand Down
6 changes: 3 additions & 3 deletions internal/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type Options struct {
JSONOutput bool
// Disable color output.
NoColor bool
// Verbose output.
Verbose bool
// Enable debugging.
Debug bool
// Show app documentation.
Help bool
}
Expand All @@ -44,7 +44,7 @@ func (opts *Options) Parse() {
)
flag.BoolVar(&opts.JSONOutput, "j", false, "Output in JSON format")
flag.BoolVar(&opts.NoColor, "nc", false, "Disable color output")
flag.BoolVar(&opts.Verbose, "v", false, "Verbose output")
flag.BoolVar(&opts.Debug, "dbg", false, "Verbose output")
flag.BoolVar(&opts.Help, "h", false, "Show app documentation")
flag.Parse()
}
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ func main() {
}))
var opts internal.Options
opts.Parse()
if opts.Verbose {
// TODO(#37): Debug and verbose should not be the same thing.
if opts.Debug {
lvl.Set(slog.LevelDebug)
}
logger.Debug("Starting ...", "options", opts)
Expand Down Expand Up @@ -101,5 +100,4 @@ func main() {
if err != nil {
internal.Fatal(fmt.Errorf("running probe: %w", err))
}
logger.Debug("Bye!")
}

0 comments on commit 07671a9

Please sign in to comment.