Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Android Logcat Package Feedback

Discussion in 'Android' started by Tomas1856, Dec 8, 2018.

  1. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Hey,

    starting from Unity 2019.1.0a11 we're introducing Android Logcat package. More info here - https://docs.unity3d.com/Packages/com.unity.mobile.android-logcat@0.1/manual/index.html

    Quick steps to set it up:
    * Unity has to have Android Support installed
    * Set active platform to be Android in Build Settings Window
    * Enable preview packages via Window->PackageManager->Advanced->Show preview packages

    PreviewPackages.jpg

    * Select and install Android Logcat
    AndroidLogcat.jpg

    * Android Logcat can be enabled via Windows->Analysis->Android Logcat
    * Alternatively when you'll do Build & Run for Android, Android Logcat will open automatically and will filter to your package.


    Feedback is very welcomed !
     
    Last edited: Feb 1, 2019
  2. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    I was excited to until I read "Unity has to have Android Support installed"I assume Android Studio.. the bit I was hoping to get rid of with this package as a replacement :)

    Also why not include a screenshot of what this thing actually looks like.. we've all seen the package manager.
     
  3. ScottF

    ScottF

    Vice President, Platforms

    Joined:
    Jul 31, 2013
    Posts:
    96
    There are a number of screenshots posted if you follow the link to the documentation at the top. Also, you do not need Android studio. You need Unity's Android support installed and the Android SDK (soon to be installed automatically by Unity). If your doing any Android developer with Unity you would already have the Android support installed.
     
    Cromfeli and Player7 like this.
  4. pahosler

    pahosler

    Joined:
    Jun 19, 2018
    Posts:
    2
    Android has cli tools, so Studio isn't necessarily a requirement. Available for Windows, Mac, and Linux
     
  5. pahosler

    pahosler

    Joined:
    Jun 19, 2018
    Posts:
    2
    Awesome!
    Now, when are we getting a stable Linux version of Unity :D
     
    FROS7 likes this.
  6. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    470
    I find Logcat a pain sometimes, so this is nice to see.
     
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    Is there an option to output logcat messages, that are specific to the game only, to the Console window too? Or do I have to use the new Logcat Window?
     
    WolveX likes this.
  8. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    This is not really a feedback on the functionality but feedback non the less... It's, uhhh, it's kind of ugly. Though it is so early in development that is probably the last thing on your minds.
     
  9. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    No, there's no option to output logcat messages to Console.
     
  10. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Can you elaborate what exactly, so we can improve? :)
     
  11. SoxwareInteractive

    SoxwareInteractive

    Joined:
    Jan 31, 2015
    Posts:
    541
    Hi @Tomas1856,
    I love the idea of having logcat directly in Unity. So thank you very much for your effort on this.

    What I've noticed is that the search bar seems to be case sensitive. Please make it case insensitive by default (I think that's what people would expect most of the time).

    I think the look of the GUI could be improved at some points:
    1. The search bar seems to be not in line with the rest of the menu bar (there is a gap of a few pixels at the top). Also the search icon is pixelated and streched (running on Windows 10 on a 1080p screen). The input text is not aligned in the vertical center.
      And it looks strange that the search bar is round at the left and has edges on the right. I would say go for edges on both sides (as that's what matches the button styles).
      As a plus, updating the filtering while typing (instead of waiting for an enter) would be amazing. It's especially weird when you remove the filter text, but the text is still filtered.
    2. There is a small gap (of 1 or 2 pixels) after each scroll bar. On the left of the horizontal scrollbar there is also a gap.
    3. The "Connected" text is not aligned in the vertical center of the footer. The green color is hard to read on the light editor skin (it works on the dark skin).
    4. Suggestion: I think it would look better if every second log line is slightly darker (or lighter) like in the default Unity console.
    5. Another Suggestion: If a filter is applied to a column, change the color slightly. This is to clearly show the user that there is an active filtering and that this might be the reason why he is not seeing certain logs.
    upload_2019-3-9_9-0-14.png

    Feature request:
    I would love to have a button "Open Terminal" so that we can access the ADB via a Terminal. There are a few things that can only be done via ADB terminal commands (deleting sideloaded apps on the Oculus GO for example).

    Thanks! I Hope this helps.
     
    Last edited: Mar 9, 2019
    xLeo, AllanRW, Deleted User and 2 others like this.
  12. Deleted User

    Deleted User

    Guest

    Thanks for your feedback.

    For search bar case sensitive: I think a toggle should help here.

    For the GUI suggestions.
    #1. Yes, we also noticed the search bar problem, have an issue filed for it.
    #2. Nice catch, will check it out.
    #3. Good point, will talk with UX guys how to set it.
    #4. Did that in the new version.
    #5. Good suggestion, will file an issue to make sure it won't be forgotten.

    About the "Open Terminal", good point! Thank you again!
     
    SoxwareInteractive likes this.
  13. SoxwareInteractive

    SoxwareInteractive

    Joined:
    Jan 31, 2015
    Posts:
    541
    @Vincent-Zhang,
    amazing, thanks for your work on this :)

    Yes this would make sense. I think case insensitive search should be the default though. (Imagine you've created some log messages because you are tracing a bug in your game. You search for the messages in the logcat window and don't find it. This would guide you in a completely wrong direction because you think your app didn't log the message although you just haven't used an uppercase for the first letter. That's exactly what happened to me and it took way longer than I hoped until I figured out that the search is case sensitive ^^).
     
  14. Deleted User

    Deleted User

    Guest

    Yeah, making case insensitive default makes sense to me too. :)
     
    SoxwareInteractive likes this.
  15. SoxwareInteractive

    SoxwareInteractive

    Joined:
    Jan 31, 2015
    Posts:
    541
    Hi @Vincent-Zhang,
    I've just played around with the Logcat Package (0.1.5) in Unity 2019.1.0f2 and I noticed some performance issues. Please notice the periodic CPU performance spikes that you can see in blue at the CPU Usage graph:

    upload_2019-4-20_9-0-56.png

    These spikes are clearly noticeable in the editor (e.g. when moving the camera through the scene or when playing in the editor). According to the profiler these spikes are caused by "AndroidLogcatConsoleWindow.RetrieveConnectedDeviceIDs()", I guess because it makes a blocking call to ADB.Run(). Moving that call into a different thread would probably solve the issue.

    Please note that I had no android device connected at this time.
     
  16. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    Omg it properly detected the unity game process and only shows the relevant logs, something I never managed to do with the android monitor, I hated filtering by tag...

    This package is fantastic! Thank you whoever made this!
     
  17. Deleted User

    Deleted User

    Guest

    Thanks @SoxwareInteractive , we have this issue tracked and will improve it in the future release.
     
    SoxwareInteractive likes this.
  18. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    I do have a complaint now, the yellow font on warnings for the non pro (gray) editor is almost unreadable.
     
    LicketyCut likes this.
  19. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    The android logcat window cause some serious hickup for me. It basically freeze the editor every 2 second for 1 second.
    Sometime it even does it when it is not in focus.
     
  20. SoxwareInteractive

    SoxwareInteractive

    Joined:
    Jan 31, 2015
    Posts:
    541
    I've noticed that too (see my previous post). I think this only happens when the logcat window is not connected with an android device. If you close the window while not using it you can workaround this issue.
     
  21. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    I think you are right. The battery of the debug device had run out when I noticed.
    Probably why I didn't notice the lag initially.
     
    SoxwareInteractive likes this.
  22. AllanRW

    AllanRW

    Joined:
    Nov 6, 2014
    Posts:
    37
    Thanks for this package its very helpful, it would be good if it clear old filters as its become a mess after some builds...

    upload_2019-6-3_17-27-6.png
     
    Nanie and yasirkula like this.
  23. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    How about if it only contained last 10 exited processes?
     
    JustAnotherDude likes this.
  24. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279


    Any way to change this text color?
     
  25. Deleted User

    Deleted User

    Guest

    We talked about letting users to pick the colors for different priorities internally, for now the only way is to change the code in `AndroidLogcatStyles.cs`...
     
    JustAnotherDude likes this.
  26. AllanRW

    AllanRW

    Joined:
    Nov 6, 2014
    Posts:
    37
    Sounds good!

    I also vote for the "open terminal" button, it will be useful!
     
  27. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    158
    Is there any way to filter out any priority? Like I get filled with Warnings but for this task I'm working on I would like to get it filtered out and show all the rest.
     
  28. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    For now - no, under the hood we're using adb logcat (https://developer.android.com/studio/command-line/logcat) priority filtering, which only accepts "the minimum level of priority to report", basically meaning if you specify Verbose, it will filter to
    • V: Verbose (lowest priority)
    • D: Debug
    • I: Info
    • W: Warning
    • E: Error
    • F: Fatal
    • S: Silent (highest priority, on which nothing is ever printed)
    if you specify Error, it will filter to

    • E: Error
    • F: Fatal
    • S: Silent (highest priority, on which nothing is ever printed)
     
  29. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    158
    Yes, I thought so. I could use a negative regex or something.

    Thanks.
     
  30. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    There seems to be a regression in the new 1.0.0 package (that is now out of preview).

    All fonts are now super blurry, line spacing doesn't work anymore, and basically everything is way less readable than before.

    This is in 1.0.0:
    upload_2019-7-31_13-48-32.png

    For comparison, this is in preview-0.2.7:
    upload_2019-7-31_13-49-34.png

    Why are there so many cases of regressions in release versions of packages :(
     
  31. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    In 1.0.0, we switched to mono space font, so messages with stacktrace addresses would be properly aligned... Out of curiosity, are you on OSX or Windows, could you copy paste the log and paste it in reply.... I saw similar bug, but couldn't reproduce it locally, does it happen for you right away after clearing the log?
     
  32. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    I'm on Windows. There are no error messages. It looks like the monospaced font you're rendering with isn't set to Hinted as the previous one was. Switching to the old package resolves the issue immediately as seen in the screenshots above, with the same log still active.
     
  33. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    1.0.1-preview was just released

    Fix & Improvements

    - Provide proper windows title for Stacktrace Utility window
    - Right clicking log lines behavior will be consistent with other Unity windows.
    - Ctrl/CMD + C will copy log lines correctly.
    - Column seperators will be drawn correctly

    Android Logcat Settings
    - Introducing settings, accessible from Preferences. For ex., on Windows Edit->Preferences
     
    ScottF and JustAnotherDude like this.
  34. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Hey, tested it again, the monospace linespacing issue is better after a restart but readability is still really really bad. It looks like you are still not using proper hinting on the monospace font asset. It's super blurry.

    I'll have to go back to 0.2.7 until that is fixed, can't read a thing, my eyes hurt.

    0.2.7 - pixel perfect properly hinted font
    20190826151237.png

    1.0.1 - weird blurry smoothed font
    20190826151012.png

    Enlarged comparison - left 0.2.7, right 1.0.1
    upload_2019-8-26_15-20-12.png
     
  35. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    1.0.3-preview

    Fix & Improvements.
    • Fix Stacktrace window not able to load when active Editor platform is not Android.
    • Fix Open Terminal button not working on Windows sometimes.
    • Reworked Connect to IP window, it's now multi threaded, thus it will not lock Editor. It's now easier to connect to Android device via IP.
    • Added icons for messages
    • Added disconnect button, you can stop logcat messages this way.
    • Improved mouse right click behavior to be consistent with the rest of Unity
    • Correctly identify Android 9 version
    • Android Settings will have color settings separated between Free skin and Pro skin.
    • Moved Android Settings under Preferences->Analysis
     
  36. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Are you just posting releases here or are you actually reading my comments? :) Would be great to get feedback.
     
  37. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Sorry, missed that.

    Honestly, I tried checking, and I don't see the issue you're seeing. Can you try setting a different font in Android Logcat Settings? Also which Unity version are you using, maybe the default font which is in logcat was changed in other version

    Also, what's your desktop resolution and size of the text Test.jpg
     
  38. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    I went to check default Unity's resources, and indeed consola font which we're using, has Rendering Mode set to Smooth. I'll try talking to people who added that font for reasons why it has been done like that, in either case if it will be decided to fix this, it will appear only with new Unity version, we cannot fix this in logcat package itself.

    We could embed font in logcat package, but that would increase both package size, and would be a resource copy-paste, so I rather not go this way.

    In the meantime, you can specify your own font through Android Logcat Settings.

    Sorry for the inconvience
     
  39. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    Please add a "pause/resume" button.

    Please, do not clear the log automatically under no circumstances.
     
    xLeo likes this.
  40. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Please check the latest preview, it has disconnect button
     
  41. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    Thank you... I'll check it out!
     
  42. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Hi @Tomas1856 ,
    I tried the latest version and seem pretty fast now.
    Can we get 2 features that will make it a real Unity Logcat?
    Because right now it's not much different than any other logcat.

    1-Collapse the whole stacktrace in a single row, with the title being the first row.
    I find it hard to debug on real device cause the logcat become a mess.
    For example this message:
    Code (CSharp):
    1. UnityIAP Version: 1.23.1
    2. UnityEngine.Purchasing.StandardPurchasingModule:Instance()
    3. UnityIAPManager:Initialize() (at Assets/Plugins/Transactions/Providers/Stores/UnityIAPManager.cs:203)
    4. Transactions.TransactionManager:RegisterTransactionProvider(TransactionProvider) (at Assets/Plugins/Transactions/TransactionManager.cs:150)
    5. Transactions.TransactionProvider:Init(ITransactionHandler) (at Assets/Plugins/Transactions/TransactionManager.cs:75)
    6. UnityIAPManager:Start() (at Assets/Plugins/Transactions/Providers/Stores/UnityIAPManager.cs:57)
    While on the editor is a simple
    Code (CSharp):
    1. UnityIAP Version: 1.23.1
    And when you click on it you see the rest. I think you can collapse them by time.

    2-Can we get automatic line selection in the c# file when double clicking on the row.
    Or at least open just the c# file itself.

    It will make debugging so much easier.
     
  43. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Editor is capable of collapsing those messages, because Editor is the one which produces those messages, thus it knows which part is stacktrace. From logcat perspective all messages are equal, both the title and the stacktrace message, so it's not very trivial to do what you're asking. I'll take a look, but no promises

    That might be doable.
     
  44. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    @Tomas1856
    How about using a special format for the stack trace output? Something that output the stacktrace in a format you can parse more easily.
    For example adding a special character plus an ID to the beginning of each log line, and if you see that special character you group the following lines by the same ID.
    The ID can be as simple as the time in milliseconds or even just a counter.
     
  45. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    That would require changes in the core Unity and maybe even in il2cpp & mono scripting backends, making changes in logcat package would be not enough.
     
  46. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    185
    Please fix the illegible yellow warning text.
     
  47. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    It should be fixed in latest preview, can you try it out
     
  48. pagan_poetry

    pagan_poetry

    Joined:
    Feb 15, 2017
    Posts:
    105
    Sorry if i post in the wrong thread, but i can't find Logcat package in Unity 2018.4.14 LTS. Is it available for this Unity version?
    If no, then what can I use to get the same functionality?
     
  49. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    185
    Tried it out. IMHO, at a glance I think the dark yellow is difficult to distinguish from black text. I think the background for the whole logcat window should maybe be darker so the original bright yellow warnings are legible.
     
  50. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Sadly logcat pacakge is available only in 2019.x builds and up, 2018.x doesn't have the necessary public API exposed.

    You can always directly call https://developer.android.com/studio/command-line/logcat