Quantcast
Channel: Questions in topic: "log"
Viewing all articles
Browse latest Browse all 235

Generic Debug Message

$
0
0
So, this has been bugging me for awhile now and altough this isnt something crucial, it would save me sometime. From time to time I have to create a Debug message to.... well, debug. And every message I create has the same format: Lets say I have a variable called assetPathAndName, which is a string and holds the message "Assets/". So my Debug.Log will be like this: Debug.Log( "assetPathAndName: " + assetPathAndName ); Which will have the following output: "assetPathAndName: Assets/". (without the quotes) How would I create a method which would only have a generic parameter (basically the types that Debug.Log supports, int, float, Vector3, string...) and would create a string containing both the variable name and the variable value? Thanks!

Viewing all articles
Browse latest Browse all 235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>