Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Application.logMessageReceived: assignment deactivates on screen errors in standalone

Discussion in 'Unity 5 Pre-order Beta' started by chrismarch, Feb 19, 2015.

  1. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    470
    I've found that adding a delegate to Application.logMessageReceived causes error and exception messages to not print onscreen in (development, script debugging enabled) standalone builds. I was under the impression that adding a delegate would make no change to Unity's behavior for Debug.LogError, etc. Is this expected behavior?
    For example:
    Code (CSharp):
    1. // This class deactivates on screen error and exception printing in standalone builds
    2. public class Foo : MonoBehaviour {
    3.     void Start { Application.logMessageReceived += NoOp; }
    4.     void OnDestroy { Application.logMessageReceived -= NoOp; }
    5.      void NoOp(string logString, string stackTrace, LogType type) { }
    6. }
    (seen in 5b18 WIndows 64-bit)