-
Notifications
You must be signed in to change notification settings - Fork 344
updates to the logging view #30
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
Conversation
lib/logging/logging.dart
Outdated
if (message.length > 200) { | ||
summary = message.substring(0, 200) + '…'; | ||
} | ||
summary = summary.replaceAll('\t', r'\t'); |
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.
What's the reason for these replacements? Won't replacing characters like this (for ex.) make an actual newline and the literal characters \n
in the users log render the same in this view? This might complicate debugging, for ex. if your app showing a literal \n
where you expected a newline?
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.
That's a good point - it would be hard to differentiate between a newline and a sequence of two \n
chars.
Without this however, you won't know if you have whitespace chars in your output - they won't show in the rendering.
I'm not sure if there's a solution that covers both situations; if no, we likely want to make the whitespace chars visible.
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.
Without this however, you won't know if you have whitespace chars in your output - they won't show in the rendering
Do you mean because they collapse in HTML? If so, don't the pre/whitespace settings help with that?
My concern here was that any manipulation of the data here could lose data - it'd be better to keep the raw string and deal with anything like this in the rendering as-appropriate? Fox ex. It might be important that the user can copy/paste an item from the log and have it as was printed verbatim?
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 mean because they collapse in HTML? If so, don't the pre/whitespace settings help with that?
It would with the formatting aspect, but not w/ knowing whether it was a tab, several spaces, ...
I can remove this part and we can re-assess if this ever comes up as an issue.
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.
but not w/ knowing whether it was a tab, several spaces
Oh, gotcha! I guess this is no different to when the user prints
and sees it written anywhere else so probably people are used to selecting/inspecting/copy&pasting to review, but we could consider a button that toggles rendering whitespace in the details?
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.
we could consider a button that toggles rendering whitespace in the details
That sounds great - a good solution. It could be a raw data vs a rendering option, esp. for some log entries where we interpret the data (frame events, gc events, ...).
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 added a note to the doc so this doesn't get forgotten (though we can start using issues here if you think makes more sense).
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.
We should likely move the work we think we're likely to do from the doc into the issue tracker.
Fix relative path for image to properly show on Pub
clear all
button to the log view@DanTup