- Home /
Debug.Log() remove callstack ?
I'm working on an android project and I have a hard time reading the output in the android console because of the callstack for EACH log output. Is it possible to just have whatever I want to log without extra information from unity ? Even better if it can be conditioned to log error only.
Thanks !
Answer by Bunny83 · Nov 15, 2017 at 02:36 PM
Well, it's possible to set the stacktrace type for a certain log message using Application.SetStackTraceLogType. So you can simply disable it for normal Log messages.
ps: I didn't know this existed but a quick google revealed this post which suggested Application.stackTraceLogType. So another quick google revealed that stackTraceLogType is obsolete. So quickly searching through Application for alternatives brought up "SetStackTraceLogType" which is even more powerful as it allows to set the stacktrace log type for each LogType individually. In the end finding the solution took less time than writing the answer.
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
This works !
ty