-
Notifications
You must be signed in to change notification settings - Fork 209
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
Limit verbosity of reporter output #215
Conversation
The verbosity levels could use more fine tuning, but this is good enough for now, and much better than before in my opinion. Upcoming changes:
|
cmp/report_reflect.go
Outdated
|
||
// PrintAddresses controls whether to print the address of all pointers, | ||
// slice elements, and maps. | ||
PrintAddresses bool | ||
|
||
// VerbosityLevel controls the amount of amount of output to produce. | ||
// A higher value produces more output. A value of zero or lwoer produces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/lwoer/lower/
cmp/report_compare.go
Outdated
if opts.VerbosityLevel < 0 { | ||
return 0 | ||
} | ||
return uint(opts.VerbosityLevel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to set a limit for this? Seems like a good number of callers for verbosity() use the return value in a shift operation. I suppose it should shift only to certain number of bits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set it to a maximum of 16, which is half the width of an int
on a 32-bit system.
A common complaint is that the reporter it prints out too much irrelevant information, resulting in a low signal-to-noise ratio. Improve this metric by imposing a verbosity limit. For nodes that are equal, we set the verbosity level is a lower value than when the nodes are inequal. Other minor changes: * Adjust heuristic for triple-quote usage to operate on more cases. * Elide type more aggressively for equal nodes. * Printing the address for a slice includes the length and capacity. * The pointed-at value for map keys are printed.
A common complaint is that the reporter it prints out too much
irrelevant information, resulting in a low signal-to-noise ratio.
Improve this metric by imposing a verbosity limit. For nodes that
are equal, we set the verbosity level is a lower value than when
the nodes are inequal.
Other minor changes: