Skip to content

Conversation

@stuartmorgan-g
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g commented Feb 13, 2019

Rather than building a description string by hand, use Diagnosticable
properties. Simplifies output, since many fields have uninteresting
default values in many cases, and makes it easier to add more loggable
properties in subclasses.

Issue #28014

Rather than building a description string by hand, use Diagnosticable
properties. Simplifies output, since many fields have uninteresting
default values in many cases, and makes it easier to add more loggable
properties in subclasses.
@stuartmorgan-g
Copy link
Contributor Author

I used my best judgment on when to use default values, and on some formatting specifics (e.g., DiagnosticsProperty for down instead of a FlagProperty), but someone who uses these log strings more might have suggestions for tweaks.

@goderbauer
Copy link
Member

/cc @jacob314

@stuartmorgan-g
Copy link
Contributor Author

@goderbauer Hixie suggested you for review, but feel free to redirect if there's a better candidate.

@jacob314
Copy link
Contributor

jacob314 commented Feb 14, 2019 via email

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. f: gestures flutter/packages/flutter/gestures repository. a: debugging Debugging, breakpoints, expression evaluation labels Feb 14, 2019
@Hixie
Copy link
Contributor

Hixie commented Feb 14, 2019

@stuartmorgan-g
Copy link
Contributor Author

Please follow the process [...]

Ah sorry, when you said not to worry about the breaking change because nobody would have done it I thought that meant it didn't need the full process. Will do when I have time.

@jacob314
Copy link
Contributor

I would be really surprised if any users are broken by refining toStringFull to not include irrelevant information. My guess would be that irrelevant information was previously included in it just because it is too inconvenient to filter out properties matching the default value when using a single large string interpolation template but someone more familiar with the API would have a better idea.

@stuartmorgan-g
Copy link
Contributor Author

Updated; this should now cause only minor tweaks in terms of output behavior from calling toString and toStringFull. I believe all comments are now addressed.

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of DiagnosticLevel.debug for all the unimportant properties looks good to me.

@stuartmorgan-g
Copy link
Contributor Author

The breaking change process is underway. Meanwhile, @goderbauer @Hixie any other comments/concerns with the current version of the patch?

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stuartmorgan-g stuartmorgan-g merged commit 62e55a4 into flutter:master Feb 25, 2019
@stuartmorgan-g stuartmorgan-g deleted the event-diagnosticable branch February 25, 2019 19:43
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: debugging Debugging, breakpoints, expression evaluation f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants