I like to print stack info (file name, line in file) along with messages when logging debug messages :
... StackTrace stacktrace = new StackTrace(true); StackFrame stackframe = stacktrace.GetFrame(0);
string currentFile = stackframe.GetFileName(); int currentLine = stackframe.GetFileLineNumber();
Debug.Log("My debug msg" + "in " currentFile + " @"+currentLine); ...
However, I can't retrieve such info from a dll used in a Unity project (line is always 0 and no file name is retrieved). This only works with scripts that are directly included in the project.
This issue makes it very hard to debug my application... Any ideas?
Doesn't Debug.Log do this for you automatically?
– superpigOh, I see - you're not actually Debug.Log()ing the data, but handing it to a UDP emitter instead? Does it still work with plain C# applications that are built and run with Mono, rather than Microsoft's CLR?
– superpig