Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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:
    218
    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:
    218
    Any news about this?
     
  4. malkere

    malkere

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

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,209
    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:
    10
    malkere likes this.
  7. malkere

    malkere

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