Although I copied this problem from the Unity forum, it is also related to C#, so I'm asking if you have any solutions
I frequently want to know what's the name of variable and its value:
Debug.Log("variableName: " + variableName); This might output "variableName: true"
I would like to only have to write something like this instead, as it is faster and if the name of the variable changes it will still display the correct name so I won't have to change this debug line:
DebugExt.Log(variableName); The output would be the same "variableName: true"
Suppose I have ten fields and just want to look at them temporarily and think of entering an extra field name for each field .....
How can I achieve this?
Question source page: https://forum.unity.com/threads/extending-debug-log-to-display-the-name-of-the-variable-automatically.763271/
Some related solutions: extending-debug-log: https://forum.unity.com/threads/extending-debug-log-to-display-the-name-of-the-variable-automatically.763271/