larsiusprime / crashdumper

A cross-platform automated crash report generator/sender for Haxe/OpenFL apps.
MIT License
113 stars 33 forks source link

did not work #19

Open hopewise opened 9 years ago

hopewise commented 9 years ago

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

jarbot commented 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.

larsiusprime commented 9 years ago

What log file are you referring to?

jarbot commented 9 years ago

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

larsiusprime commented 9 years ago

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.

jarbot commented 9 years ago

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.

larsiusprime commented 9 years ago

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.

jarbot commented 9 years ago

Yeah that would be perfect!

larsiusprime commented 9 years ago

Gimme a sec

larsiusprime commented 9 years ago

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.

hopewise commented 9 years ago

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"

jarbot commented 9 years ago

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

jarbot commented 9 years ago

The trace functionality is working as expected. Thank you!

hopewise commented 9 years ago

@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

jarbot commented 9 years ago

@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.

hopewise commented 9 years ago

@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..

jarbot commented 9 years ago

@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

hopewise commented 9 years ago

Thanks @jarbot for link, I will check that