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

Correct approach to catch exceptions and logging system globally

Discussion in 'Scripting' started by mahdiii, Jul 3, 2020.

  1. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    856
    Hey. I want to control exceptions globally, log and send them to a server in a suitable format. (in dev and release).
    Should I have used logMessageReceived? Any better approach?
    In release, can I be sure Unity catches exceptions globally and so, only in that script, the next lines are not executed?
    Code (CSharp):
    1. Application.logMessageReceived += OnLogMessageReceived;