saravanarajan / acra

Automatically exported from code.google.com/p/acra
0 stars 0 forks source link

Report doesn't send the latest value of custom variable, only the initial value #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I added two custom variable to the reporting as follows:

ErrorReporter.getInstance().addCustomData("subscriberId", subscriberId);
ErrorReporter.getInstance().addCustomData("activityLog", ACTIVITY_LOG_STRING);

where ACTIVITY_LOG_STRING is a static class variable of my Application class 
that extends CrashReportingApplication.

For testing I set it as follows:
public static String ACTIVITY_LOG_STRING = "initial value";

but within the app I _do_ change the value.

When I logcat the value of it, I see the correct values, but the ACRA report 
would only take it's initial value, not the updated one, as stated in the FAQ 
("*only latest value for each one*"):

" All your custom data (*only latest value for each one*) will be added in the 
column "custom" just before the stack trace, one key = value pair per line. "

What is the expected output? What do you see instead?
The latest value should be reported, but I only see the initial value.
In my logcat output for debugging I see though that the value is definitely 
changing within my app.

What version of the product are you using? On what operating system?
Android 2.1update1

Please provide any additional information below.

Original issue reported on code.google.com by mathias....@gmail.com on 30 Aug 2010 at 8:42

GoogleCodeExporter commented 9 years ago
btw: I'm calling the
ErrorReporter.getInstance().addCustomData("activityLog", ACTIVITY_LOG_STRING);
in my OnCreate of the application.

Original comment by mathias....@gmail.com on 30 Aug 2010 at 8:47

GoogleCodeExporter commented 9 years ago
Hm, nevermind, I just looked at the source code of the ErrorReporter, where it 
says "You should call this at several key places in your code the
     * same way as you would output important debug data in a log file. Only the
     * latest value is kept for each key"
I thought it's reading the current value via reflection, but seems not. 
Therefore I moved the addCustomData to another place. Works ok now.

Original comment by mathias....@gmail.com on 30 Aug 2010 at 9:05

GoogleCodeExporter commented 9 years ago

Original comment by kevin.gaudin on 6 Sep 2010 at 9:49