Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Disabling the logging at runtime

Discussion in 'Unity Cloud Diagnostics' started by Sebioff, Sep 28, 2015.

  1. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    180
    There should be a way to turn off the crash reporting logging at runtime - for example if the game is being modded we'd rather not receive any error logs at all instead of getting spammed by errors from the mods as it's currently the case (making it hard to find reports caused by our own code).
     
  2. andyk-unity

    andyk-unity

    Unity Technologies

    Joined:
    Dec 11, 2013
    Posts:
    37
    Currently, there isn't a way to turn off the logging at runtime.
     
  3. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    180
    Any news about this?
     
  4. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,027
    Last edited: Apr 13, 2019
  5. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,027
    I've setup

    Code (CSharp):
    1. #if UNITY_EDITOR
    2. using UnityEditor;
    3. #endif
    4.  
    5. #if UNITY_EDITOR
    6. [InitializeOnLoad]
    7. public static class EditorQuit {
    8.  
    9.     static void PlayChange(PlayModeStateChange state) {
    10.         if (state == PlayModeStateChange.ExitingPlayMode) {
    11.             UnityEditor.CrashReporting.CrashReportingSettings.enabled = true;
    12.         }
    13.     }
    14.  
    15.     static EditorQuit() {
    16.         EditorApplication.playModeStateChanged += PlayChange;
    17.     }
    18.  
    19. }
    20. #endif
    to turn it on when I leave play mode, and similar in a Start() method to turn it off when I enter play in the editor, but it doesn't solve the problem of runtime management.
     
  6. emilyn_unity3d

    emilyn_unity3d

    Unity Technologies

    Joined:
    Mar 14, 2018
    Posts:
    8
    malkere likes this.
  7. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,027
    Awesome! Thank you emilyn