I’m working on a tool that captures log output in game and allows it to be saved to file.
It’s all working correctly, except for the log output does not include stacktraces when run from Webplayer.
The stacktrace is captured for exceptions, but not for normal logs.
If I run from the editor in Webplayer mode, I can see the stacktraces are captured, but as soon as I build it and run it as the webplayer the stacktraces disappear.
Standalone works as expected with the same code for capturing the logs.
Is there a reason for this, and is there any way I can force the stacktraces to be included in the Webplayer?
The tool is a bug reporter, so the stacktraces are helpful in determining where in the code things are breaking.
Examples:
Webplayer log capture:
[LOG];4/29/2013 1:40:03 AM +0000;0
[LOG];4/29/2013 1:40:03 AM +0000;1
[LOG];4/29/2013 1:40:03 AM +0000;2
[LOG];4/29/2013 1:40:03 AM +0000;3
[LOG];4/29/2013 1:40:03 AM +0000;4
[EXCEPTION];4/29/2013 1:40:03 AM +0000;IndexOutOfRangeException: Array index is out of range.
FUBARTester.BreakLog ()
FUBARTester.Start ()
Standalone Log Capture:
[LOG];4/29/2013 1:40:42 AM +0000;0
UnityEngine.Debug:Log(Object)
FUBARTester:BreakLog() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:32)
FUBARTester:Start() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:16)
[LOG];4/29/2013 1:40:42 AM +0000;1
UnityEngine.Debug:Log(Object)
FUBARTester:BreakLog() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:32)
FUBARTester:Start() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:16)
[LOG];4/29/2013 1:40:42 AM +0000;2
UnityEngine.Debug:Log(Object)
FUBARTester:BreakLog() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:32)
FUBARTester:Start() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:16)
[LOG];4/29/2013 1:40:42 AM +0000;3
UnityEngine.Debug:Log(Object)
FUBARTester:BreakLog() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:32)
FUBARTester:Start() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:16)
[LOG];4/29/2013 1:40:42 AM +0000;4
UnityEngine.Debug:Log(Object)
FUBARTester:BreakLog() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:32)
FUBARTester:Start() (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:16)
[EXCEPTION];4/29/2013 1:40:42 AM +0000;IndexOutOfRangeException: Array index is out of range.
FUBARTester.BreakLog () (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:31)
FUBARTester.Start () (at C:/Users/Public/Documents/Unity Projects/FUBAR/Assets/FUBAR/FUBAR Scripts/FUBARTester.cs:16)