-
-
Notifications
You must be signed in to change notification settings - Fork 586
fix: should print max information by default #3459
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,16 +19,17 @@ type Logger interface { | |
| Printf(format string, v ...any) | ||
| } | ||
|
|
||
| // defaultLogger is the default Logger instance. | ||
| var defaultLogger Logger = &noopLogger{} | ||
| // defaultLogger would print available information to stderr | ||
| var defaultLogger Logger = log.New(os.Stderr, "", log.LstdFlags) | ||
|
|
||
| func init() { | ||
| // Enable default logger in the testing with a verbose flag. | ||
| if testing.Testing() { | ||
| // Parse manually because testing.Verbose() panics unless flag.Parse() has done. | ||
| // Disable logging if explicitly disabled via -test.v=false | ||
| for _, arg := range os.Args { | ||
| if strings.EqualFold(arg, "-test.v=true") || strings.EqualFold(arg, "-v") { | ||
| defaultLogger = log.New(os.Stderr, "", log.LstdFlags) | ||
| if strings.EqualFold(arg, "-test.v=false") { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Create a public constructor for the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @strowk what are your thoughts on this?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Easy enough - fba533f |
||
| defaultLogger = &noopLogger{} | ||
| break | ||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.