crashdumper icon indicating copy to clipboard operation
crashdumper copied to clipboard

did not work

Open hopewise opened this issue 9 years ago • 17 comments

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:

<haxedef name="HXCPP_STACK_LINE" />
<haxedef name="HXCPP_STACK_TRACE" />

Thanks for great extension, I think it might need minor fix? I am haxe 3.2.1

hopewise avatar Oct 26 '15 03:10 hopewise

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.

jarbot avatar Oct 29 '15 19:10 jarbot

What log file are you referring to?

larsiusprime avatar Oct 29 '15 19:10 larsiusprime

I assumed @hopewise was referring to the output from logcat.

jarbot avatar Oct 29 '15 19:10 jarbot

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.

larsiusprime avatar Oct 29 '15 19:10 larsiusprime

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.

jarbot avatar Oct 29 '15 20:10 jarbot

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.

larsiusprime avatar Oct 29 '15 20:10 larsiusprime

Yeah that would be perfect!

jarbot avatar Oct 29 '15 20:10 jarbot

Gimme a sec

larsiusprime avatar Oct 29 '15 20:10 larsiusprime

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.

larsiusprime avatar Oct 29 '15 21:10 larsiusprime

I am experimenting on my galaxy S3, it has android 4.4.4 , here is a snapshot that shows the path and file name: crashdump

And here is the file content: crashdump2

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"

hopewise avatar Oct 30 '15 04:10 hopewise

Awesome thanks @larsiusprime I will try it out tomorrow. Many thanks.

jarbot avatar Oct 30 '15 05:10 jarbot

The trace functionality is working as expected. Thank you!

jarbot avatar Oct 30 '15 16:10 jarbot

@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 avatar Oct 31 '15 04:10 hopewise

@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 avatar Nov 02 '15 20:11 jarbot

@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 avatar Nov 03 '15 21:11 hopewise

@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

jarbot avatar Nov 03 '15 21:11 jarbot

Thanks @jarbot for link, I will check that

hopewise avatar Nov 04 '15 09:11 hopewise