Flutter-intellij: Improve Copy / Paste on new Logging View

Created on 30 Jun 2018  Â·  21Comments  Â·  Source: flutter/flutter-intellij

Hey hey :) I've been trying out the new logging view and wanted to provide a bit of feedback wrt copying and pasting logged messages. It's a pretty common task when running into bugs in a larger app where another team might be responsible for the feature you're navigating through and you encounter an error. I might want to create a new ticket with the StackTrace, or paste it into slack for discussion.

Issue 1: Use cmd+c to copy a log Message

  1. Enable new logging view (applies to all of these)
  2. Run the app
  3. See a log message or many messages you're interested in copying
  4. Highlight it and press cmd+c to copy
  5. Get output like this when pasting:
io.flutter.logging.FlutterLogEntry@76b5b7da | io.flutter.logging.FlutterLogEntry@76b5b7da | io.flutter.logging.FlutterLogEntry@76b5b7da | io.flutter.logging.FlutterLogEntry@76b5b7da
-- | -- | -- | --

Workaround: Secondary-click on the message, click "Copy asText". This now produces a result I was expecting:

13:30:48.572 2508 800 flutter.tools Restarted app in 1,230ms.

or with multiple lines:

13:30:48.572 2508 800 flutter.tools Restarted app in 1,230ms.
13:30:47.834 2509 400 runtime.gc collection time 1ms • 26.2MB used of 27.2MB • isolates/21837764
13:30:48.007 2510 400 runtime.gc collection time 2ms • 30.0MB used of 31.2MB • isolates/21837764

Issue 2: Copy a portion of the message

Say I want to filer down to a specific message. Rather than typing it in (error-prone, sometimes long), it'd be great to copy only a portion of the message rather than "Copy as Text" and have to remove the bits I don't want.

  1. Run app with new logging view
  2. Attempt to select only a portion of the logged message, e.g. I wanted to copy "Restarted app" from the message "Restarted app in 1,230ms."
  3. Can't quite see a way to do this

Thanks for all the hard work and community effort on this feature!

logging

All 21 comments

@brianegan, Thank you for the great feedback.
@pq, I think there is something need to improve.

Issue 1:

  • flutter log level should display text (eg: info/fine/finer) instead display a number (eg 800, 400).
  • update text copy.

For issue 2:

  • Currently we use TreeTable so I'm not sure if there a way to copy a portion of the message :|

I already create a new PR for fixing copy by shortcut: https://github.com/flutter/flutter-intellij/pull/2455
@pq, please check it next week :)

For the issue 2 ( Copy a portion of the message) I think we should have more discussion :)

Sounds good, thanks for helping out!

Awesome. Thanks for the feedback @brianegan and for the quick fixes @quangson91!

Regarding

Attempt to select only a portion of the logged message, e.g. I wanted to copy "Restarted app" from the message "Restarted app in 1,230ms."

I simplified the selection model to default to whole rows (and not cells), thinking this was generally what folks want. Of course, now you've got me wondering. 🤔

Definitely open for discussion!

@pq Yah, I think the default Cell selection makes sense in a lot of cases. Would it be possible to change it so you could double-click on a Cell to go into an "Editing Mode" or "Selection Mode" that would allow you to copy the text? Might be the best of both worlds, but I'm not sure if Cell View in IntelliJ supports that kinda feature.

Thanks again to all for your time!

I was thinking about this too actually. (Alternatively, it might be a mode toggled in the side action bar...) For my edification, what's the specific use case? Does it happen often that you just want part of a log?

Thanks for the continued conversation!

Sure, use-cases are a good idea! The two use cases that led to this:

  1. I wanted to copy part of an error message to paste it into a Google Search to see if others were running into the same exception. I had to copy the whole thing then chop out the bits I wasn't interested in.
  2. I wanted to copy only a portion of a Log message from the Redux Logging package so I could paste that into the text filter and filter down to only Redux Logging messages. I ended up just typing this in.

@pq, @brianegan what about when user click to the cell/row we display a small dialog/popup with log content -> user can copy a part of a log as they want ?

Maybe a double-click instead of a single click? Seems reasonable that peeps might want to single click on a row or select a few rows, then hit "copy" to get the whole thing.

Overall, it's kinda hard to say haha... Not sure if it's overkill, but I wonder if there are some metrics that could be added/tracked or UX results that could help the team understand the most common use case?

ah yeap, it must be a double-click.
@pq what do you think?
if that ok -> I will implement it.

Seems reasonable that peeps might want to single click on a row or select a few rows

@brianegan
=> I'm not sure we can handle double-click when user select a few rows :|

@quangson91 From my perspective, that's totally fine. At least in my use-case, it's been copying a bit of text from a single line.

The case involving multiple lines usually means I'm copying a bigger stacktraces so I can paste those lines into a bug report / slack channel. Just didn't want to hurt that functionality by saying "single-click = display a popup".

@brianegan got it.

Thanks for all your help @quangson91 & @pq :)

Great ideas! A couple of quick thoughts:

  1. I agree that selecting a single cell is probably OK -- especially since it seems to support the main use case; which leads me to ask:
  2. @brianegan : ideally, would a double click get you to a mode where you can select specific text within a given cell? It sounds like that's the goal.

As for:

I wonder if there are some metrics that could be added/tracked or UX results that could help the team understand the most common use case?

We do have a means for capturing analytics. When this is all more baked we can totally look at adding some tracking.

Cheers!

ideally, would a double click get you to a mode where you can select specific text within a given cell? It sounds like that's the goal.

Yep! How it's done, whether the text in the cell becomes "Selectable" or "Editable" at that point, or if it shows a little popup I can copy from, is a bit of a "Design" question that requires experimenting a bit and seeing what works / feels best.

Overall, a solution to the use cases stated above, whatever implementation you all feel works best, would be fantastic.

@pq, @brianegan, I created a new PR: https://github.com/flutter/flutter-intellij/pull/2473
with two features:

  • support copy a part of the log.
  • support search a part of the log with Google.

Woah, sweet! Nice work @quangson91 :) Thanks so much!

Yeap, glad to hear that from you ^^.
Thank you!

w/ #2473 landed I think this is good to close?

@brianegan?

Yep! This provided the functionality I was looking for :)

Was this page helpful?
0 / 5 - 0 ratings