Open hopewise opened 9 years ago
crashdumper creates a txt file saved to the device. it does not trace to the log as far as I know, but that would be a nice option.
What log file are you referring to?
I assumed @hopewise was referring to the output from logcat.
Ah, so a mobile device thing? I'd be happy to output to that if I knew how. As of right now crashdumper reports the crash via trace(), and writing a file to disk. I could add more logging methods, but I don't have a mobile device so I'd have to lean on the community a little for stuff like that.
trace() shows up in logcat on android and ios but I don't think crashdumper is logging when the stack trace is collected, I could be wrong or it might be trace stops working after a crash. I added my own traces and got stack traces to show up but I can't recall where I put them.
Something like this?
if (traceToLog)
{
trace("CRASH session.id = " + session.id);
trace("MESSAGE = " + errorMessage);
}
That should include the same basic information that's currently being logged to disk.
Yeah that would be perfect!
Gimme a sec
Okay, Crashdumper now has a third parameter in the private doErrorStuff function:
private function doErrorStuff(e:Dynamic, writeToFile:Bool = true, sendToServer:Bool = true, traceToLog:Bool = true):Void
if traceToLog
is true then it will also output the crash dump message via trace(), and this should include the stack trace and regular information. If you override doErrorStuff be advised you'll have to update your function signature. If you do nothing, the parameter is true by default so it should trace out now if you update.
Let me know how this behaves.
I am experimenting on my galaxy S3, it has android 4.4.4 , here is a snapshot that shows the path and file name:
And here is the file content:
What I expected is that it will include the stack trace into the _error.txt file So, how would I get the stack trace? as I already set in build.xml: haxedef name="HXCPP_STACK_LINE" haxedef name="HXCPP_STACK_TRACE"
Awesome thanks @larsiusprime I will try it out tomorrow. Many thanks.
The trace functionality is working as expected. Thank you!
@jarbot, did you successfully viewed the error stack list? can you please deploy a simple project example? as you can see above the stack is empty
@hopewise I am able to see the stack trace in logcat as well as the txt file generated by crashdumper. I would be more than happy to test a simple project.
@jarbot thank you, as for logcat, wouldn't it view tons of non-my-app related info beside my app's log? is it possible to let it view only my app logs? is there a tool to make it simple?
also, I will truly appreciate it if you can share your simple working project that could trace logs to logcat..
@hopewise sorry I was confused I thought you had a simple project you wanted me to test. It will take me a bit of time to get a sample project running.
You can use the Monitor app that is provided by the android sdk. Make sure you have installed the platform tools. http://developer.android.com/tools/help/monitor.html This tool has a handy console where you can filter by tag, pid, app name, etc.
Or from the command line you can do a simple filter like this to see logs for your app:
adb logcat | grep trace
This is pretty rudimentary but works for basic trace debugging and seeing the stack trace from crashdumper
Thanks @jarbot for link, I will check that
I am using openfl 3.3.9, I've opened the log file, but it has no lines number nor stack, I tried to both release and debug build, I've included both of:
Thanks for great extension, I think it might need minor fix? I am haxe 3.2.1