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

5.4 Integration: Disable in editor

Discussion in 'Unity Cloud Diagnostics' started by Tuni, Jul 27, 2016.

  1. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    74
    Hi,

    is there an easy way to disable the reporting in the editor? We don't want to see all errors that are created during development in the editor.

    Greetings

    Tim
     
  2. DodgeRollRubel

    DodgeRollRubel

    Joined:
    Jul 28, 2016
    Posts:
    4
    I'd like an option to disable this at runtime as well... We'd like to push this to all of our users, as the additional feedback for exceptions is extremely helpful, but feel that we should provide them with an option to opt out if they'd like. I'd also like to prevent messages come from modded clients, so we don't spend time tracking down bugs that don't exist in the shipping executable.

    EDIT: Being able to reassign the version number used for reporting at runtime would help with the editor and modding issues (when we can filter the reports by version), but supporting opt-out would be ideal!
     
    Last edited: Jul 28, 2016
  3. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    74
    In the announcement Chris Lundquist wrote:

    http://blogs.unity3d.com/2016/06/23/the-state-of-performance-reporting-ii/

    But there is no namespace Connect, so it doesn't work.
     
  4. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    432
    There is a UnityEditor.Connect namespace actually but it contains nothing resembling that (no CrashReportingSettings or similar)
    Checked with ILSpy
     
  5. DodgeRollRubel

    DodgeRollRubel

    Joined:
    Jul 28, 2016
    Posts:
    4
  6. JJJohan

    JJJohan

    Joined:
    Mar 18, 2016
    Posts:
    214
    After some searching, I believe the new way to disable it is via:

    PlayerSettings.enableCrashReportAPI = true/false


    Well that isn't it. Depending on how far you're willing to go, you can edit the UnityConnectSettings.asset file in the ProjectSettings folder and modify this during your build/release process.
     
    Last edited: Aug 9, 2016
  7. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    74
    This is so bad. We have to change config files because Unity does not offer options to change such simple things.

    It was a much better solution at the time it was not integrated into the engine. You can't disable it from code and you can't change the version number from code. This inflexible and closed source plugin and the lack of communication in this thread makes me sad.
     
  8. ChrisLundquist

    ChrisLundquist

    Unity Technologies

    Joined:
    Mar 2, 2015
    Posts:
    55
    Let me apologize to begin with, this isn't our best work, and this shouldn't be the default behavior. GamePerf should have gotten more polish. I can see where you are all coming from, and how frustrating this must be.

    The default behavior should not send exceptions from play mode in the editor, and there should be an API to toggle this.

    I also made a mistake in the comments of the announcement.

    > There is a UnityEditor.Connect namespace actually but it contains nothing resembling that (no CrashReportingSettings or similar)
    > Checked with ILSpy

    It is UnityEngine.Connect rather than UnityEditor. In either case, this is marked as internal now so it isn't a viable fix anymore. (The Editor side looks like it is UnityEditor.Web.CrashReportingAccess, but that is also internal. This is the glue the services window uses to turn it off and on. )

    The reason I haven't responded sooner, is that I didn't have a good answer. I probably should have said just that, and I didn't.
    It may be time to do a post mortem on the feature soon, perhaps along with the overall 5.4 post mortem. This doesn't feel like the right place to go into everything though.

    What I can say is that the GamePerf team almost all have competing responsibilities. We only just recently got a dedicated dev, who is working hard on the much requested native crashes feature. We're also shipping some UI improvements soon. In there was also task of changing to the common data pipeline, so that all the Unity Services talk to the same place from the editor / runtime. This ground work happened towards the end of 5.4, and will probably go live in 5.5.

    Sadly, the solution isn't simply just to remove the internal keywords. The original version of the editor integration allowed you to dynamically enable and disable crash reporting. During some transitions towards the common data pipeline, this ability was removed as other services didn't have this ability. This means that even if we exposed the API as it is today, turning it off after it started wouldn't do much, while originally it would call all the teardown functions.

    As far as immediate solutions go, there are a couple, but none of them are really that great.
    The easiest option is to continue using the C# plugin. The latest version should work in 5.4.
    We haven't done a great job of saying when we make new versions either.
    https://public-cdn.cloud.unity3d.com/UnityCrashLog.unitypackage
    Should always be the latest.
    Certain versions are there as well, such as
    https://public-cdn.cloud.unity3d.com/UnityCrashLog-v1.2.0.unitypackage
    (The choices are 1.0.0, 1.1.0, 1.2.0 at the moment, please use the latest version)

    Another option is to make an /etc/hosts entry to trick DNS for perf-events.cloud.unity3d.com to point to localhost.
    This would cause exceptions from your laptop/computer to effectively get dropped.
    This *should* be safe, but I haven't tried it yet. There is a possibility it could hide your crash reports on the website from you. ( I don't *think* this will happen though, as I believe the UI hits perf.cloud.unity3d.com )

    Another option is to disable the service while in the editor, then enable it just before a standalone build.
    Clicking the button will set it on the server, but that is only to keep the button in a consistent state when using collab.
    Since the setting gets baked into standalone builds, existing clients will keep sending reports.
    Naturally, the "Gotchya" here is it is easy to forget.

    Long term, the solution should be to swap the default to not send reports in the editor, and expose API access.
    I don't know when this will happen. I've passed these forum posts to the devs doing the common data pipline work, and we're looking at what it would take. I'm *hoping* that we can get this in trunk and back port it into the 5.4 patch releases.

    Hope this helps,
    Chris Lundquist
     
  9. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    74
    Thank you for your answer @ChrisLundquist ! We like the crash reporting in Unity 5 because it helps us finding the last problems in our game. Our current solution is to modify the application version in the editor playmode. This was okay at the time when only one dev worked on an game that is already live (e.g. bugfixing). But now we have a few team members more on the project to create additional content and new features. The result is that 9 out of 10 crash reports are from the editor. It's hard to find the real crash reports now with this solution.

    We will disable the crash reporting and enable it just for a release build. The problem with is that this requires an additional step to do before building. Our current approach is to do the critical tasks (building the game for multiple platforms or stores is one of them) automatically. It's just one click at the moment, everything else is automated.

    Imo it's an important change to stop sending crash reports from the editor playmode. Because if you want to support your game after launch you can get confused if you don't know that (and don't search in the forums). If you are a studio with a few people on the project (we are 7 without freelancers) you have enough people to screw up your data.

    This is a problem for analytics too. I think you should rethink the integration of the Unity services in the editor. Maybe a global flag for enable/disable a sandbox mode which only affects the editor. So you can test analytics and other services early in the development cycle and turn it off later.
     
  10. smallbit

    smallbit

    Joined:
    Oct 3, 2013
    Posts:
    60
    Sorry but this is actually very easy, just check the affected OS, if its from editor you will see there Mac OSx or windows or whatever else you use :)

    To add to the topic I do would like to have it as an option.
     
  11. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    823
    Hey there,

    Is there any progress/quickfix on that feature?
    @ChrisLundquist : I agree, using game performance in the editor should be opt in rather than not possible to disable.
     
  12. thomasn_unity

    thomasn_unity

    Unity Technologies

    Joined:
    Jun 21, 2016
    Posts:
    60
    We have added the ability to disable capture of exceptions occurring in the editor in 5.5. It will simply be a checkbox in the Game Performance services window. However, I don't think it made 5.5.0b9, so look for it in the next release. It is going to be opt-out in order to be consistent with previous behavior. We're not currently planning to back-port it to 5.4
     
    AdamKane and Novack like this.
  13. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I'm not finding an obvious answer to this question, or rather the preferred answer.
    The checkbox in the editor works of course, but I don't want to have to manually turn it on every time I go to build my game, and turn it off again after I'm done to stop crash and exception reports from the editor clogging my dashboard up. Furthermore this is something that really pisses a tiny percentage of players off, and they need to be able to opt-out in runtime.

    https://docs.unity3d.com/ScriptReference/CrashReporting.CrashReportingSettings.html

    is an Editor only option from the looks of it. Is there no way to let players opt out of anonymous reporting?

    https://forum.unity.com/threads/disabling-the-logging-at-runtime.357753/#post-4424095
     
    Last edited: Apr 13, 2019
    Novack likes this.
  14. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Novack likes this.