Search Unity

An idea for function call logs.

Discussion in 'Scripting' started by mikelowefedex, Nov 3, 2020.

  1. mikelowefedex

    mikelowefedex

    Joined:
    Sep 29, 2020
    Posts:
    139
    Hello,
    I was wondering, wouldn't it be great if there was a way to find out what function called what in a debug screen? Lets say somebody spent weeks writing code, and later wanted to find out what called a certain function from what line. Errors get logged into the console that way. What if there was a way to have a print method do the same?
     
  2. mikelowefedex

    mikelowefedex

    Joined:
    Sep 29, 2020
    Posts:
    139
    Never mind. I see it is logged.
     
    Bunny83 and PraetorBlue like this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    There's less information in a release build. I've just gotten into the habit of writing Debug.Log like this.
    Code (csharp):
    1. Debug.Log("playerObject is null in updatePlayerHealth() playerStats.cs");
     
  4. Dextozz

    Dextozz

    Joined:
    Apr 8, 2018
    Posts:
    493