8000 chore: debug lines review by jesusprubio · Pull Request #50 · jesusprubio/up · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: debug lines review #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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