Search Unity

Push custom log entries?

Discussion in 'Unity Cloud Diagnostics' started by BenWoodford, Dec 2, 2016.

  1. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    A lot of the time, I want to try/catch Exceptions but still log them so that I know it's an issue (or when working with a client, to save them sending me the output log).

    Is there no way to push a message to the Game Performance logger without throwing an exception?
     
  2. thomasn_unity

    thomasn_unity

    Unity Technologies

    Joined:
    Jun 21, 2016
    Posts:
    60
    Hi, you can use Debug.LogException to send handled exception details to the Game Performance service. Just call that with the exception from inside your catch block. Or you could even define your own exception type for some error condition and log it that way.

    I would caution against using this too much though, as it could result in excess network traffic for your users if you're sending too many events. Try to reserve it for the special cases that you really need to know about.
     
  3. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    Good to know thanks! I did wonder if that would send one, kinda assumed it was handled prior to that for some reason.