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. Dismiss Notice

Question Debugging and Error Logging(Logcat - Player Log)

Discussion in 'Scripting' started by Wilhelm_LAS, Jun 12, 2023.

  1. Wilhelm_LAS

    Wilhelm_LAS

    Joined:
    Aug 18, 2020
    Posts:
    35
    So i am thinking to make a game and i was thinking about Debugging and Error Logging such as Crashes, Fetch errors and other many errors... I want a log file that logs everything or just crashes.
    It would be cool if player will able to find that log file easily so when i want the file, i can just ask them that way whatever so.

    As you know, we can debug a game with USB but thats not what i want. Imagine i live in Moon and other Player is in Galaxy 124j32. We downloaded the same game and tried. Now he got a problem! He was walking in game and suddenly, hes app crashed!! It would be easier to know the problem with a crash log if there was any.

    I bet Unity has that functionality but i dont know... someone help lol :(
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    The
    Application
    class has some logging callbacks you can hook.

    If you crash hard enough though, the crash itself might not make it to disk.
     
    Wilhelm_LAS likes this.
  3. Wilhelm_LAS

    Wilhelm_LAS

    Joined:
    Aug 18, 2020
    Posts:
    35
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Don't conflate the two processes.

    1. You hook the delegate in Application in order to receive log messages

    2. If you want to write those messages to disk, that's on you.

    Otherwise, hook up one of the third party crash reporting libraries. I won't recommend any of them because they're all a royal pain in the butt to deal with.
     
    Wilhelm_LAS likes this.