ACRA - LogTracker

502 views
Skip to first unread message

Sebastiano Gottardo

unread,
Jun 20, 2011, 10:50:34 AM6/20/11
to acra-discuss
Hi there. We are an italian development team called MegaDevs and we
are using ACRA on our Android applications, since we find it very
useful. On the other hand, sometimes handling a large quantity of logs
(+1000) can become rather complicated; also, we were needing for some
filtering solution between the logs.

So we developed a Java-based desktop application which is able to
connect to a Google account and fetch log informations from an ACRA-
generated spreadsheet. The logs are then available on a list: by
clicking on an element, the log content is displayed in the center
area of the application. What is more, it is possible to apply an
unlimited number of filters to the logs collection, in order to
restrict the collection with the available parameters.

The application is still in development, so there might be a few bugs.
In particular, the filters part features just 3 filters at the moment:

[*] board - equals - anyvalue
[*] app_version - equals - anyvalue
[*] package_name - equals - anyvalue

All of the other filters will be added in the next two weeks, for
sure.
If you find this useful, please feel free to link our work to your
users. The code is fully available on GitHub:

https://github.com/MegaDevs/ACRA_LogTracker

Any suggestions or comments are very welcome :)

Sebastiano,
MegaDevs team

Kevin Gaudin

unread,
Jun 20, 2011, 10:55:37 AM6/20/11
to acra-d...@googlegroups.com
Hi,

Thank you very much for sharing your work on this app !!!

I'm deeply interested by the different ways people are developing to manage their reports. My next development focus will be on reports handling and analysis, and the possible relation with other development tools.

I will try to test it this evening !

Kevin

mot12

unread,
Jun 20, 2011, 11:16:28 AM6/20/11
to acra-d...@googlegroups.com
That's pretty neat. Thank you for making this public.

I have to manage several thousand reports per day myself and I am using scripts in Google spreadsheet to filter the reports (and delete irrelevant entries) and to colorize the remaining reports. While not very versatile, this was done in a few hours. Obviously, the code below requires your modification before you can use (careful, it WILL delete entries if you just run it). So if you like a simple script to get started on your filtering nees:

function onOpen() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var menuEntries = [ {name: "filter", functionName: "filter"},
                    {name: "colorize", functionName: "colorize"},
                    {name: "hide", functionName: "hide"},
                    {name: "show", functionName: "show"}];
  ss.addMenu("ARCA", menuEntries);
}

var curVersion = "3.1.3";

var nCol = 28;
var maxRows = 2000;

function filter()

{
  var sheet = SpreadsheetApp.getActiveSheet();
  var range = sheet.getActiveRange();
  var row1 = range.getRow();
  var rowCnt = range.getLastRow() - row1 + 1;
  Browser.msgBox("row1 " + row1 + ", " + rowCnt + " rows");
 
  if (row1 < 2)
    row1 = 2;
  if (rowCnt > maxRows)
    rowCnt = maxRows;
  if (rowCnt > sheet.getLastRow() - row1 + 1)
    rowCnt = sheet.getLastRow() - row1 + 1;
 
  var data = sheet.getRange(row1, 1, rowCnt, nCol).getValues();
  var out = new Array(rowCnt);
 
  var outY = 0;
  for (var y = 0; y < rowCnt; y++) { 
    var version = data[y][1];
    var custom = data[y][21];
    var stack = data[y][22];
    var comment = data[y][26];
    var removeStack = false;

    // delete empty rows
    if (data[y][0] == "" && stack == "") {
      continue;
    }
   
    // delete errors of old versions
    if (comment == ""
        && version.indexOf("b") == -1 // keep beta
        && (version.indexOf(curVersion) == -1 || custom.indexOf("media prepare io") > 1) // keep current version
        && custom.indexOf("error") > -1 // error line
        && custom.indexOf("key not found") == -1 // keep this one
        && custom.indexOf("wrong key") == -1) { // keep this one
      continue;
    }
   
    // remove stack?
    if ((custom.indexOf("upload") > -1 || custom.indexOf("registration") > -1)
       && custom.indexOf("error") == -1
       || custom.indexOf("wrong key") > -1) {
        removeStack = true;
    }
   
    // copy row into output but omit X-Z
    out[outY] = new Array(nCol);
    for (var x = 0; x < nCol; x++) {
      out[outY][x] = "";
      if ((x == 22 && !removeStack) || x < 22 || x > 25) {
        out[outY][x] = data[y][x];
      }
    }
    outY++;
  }

  // write shortened sheet
  var nOut = outY;
  for (; outY < rowCnt; outY++) { 
    out[outY] = new Array(nCol);
    for (var x = 0; x < nCol; x++) {
      out[outY][x] = "";
    }
  }
  sheet.getRange(row1, 1, rowCnt, nCol).setValues(out);
  if (rowCnt-nOut > 0) {
    sheet.deleteRows(nOut+row1,rowCnt-nOut);
  }
  Browser.msgBox("deleted " + (rowCnt-nOut) + " rows. Current: " + (nOut+row1));
 
  colorize();
}

function colorize()

{
  var sheet = SpreadsheetApp.getActiveSheet();
  var range = sheet.getActiveRange();
  var row1 = range.getRow();
  var rowCnt = range.getLastRow() - row1 + 1;
 
  if (row1 < 2)
    row1 = 2;
  if (rowCnt > maxRows)
    rowCnt = maxRows;
  if (rowCnt > sheet.getLastRow() - row1 + 1)
    rowCnt = sheet.getLastRow() - row1 + 1;
 
  var data = sheet.getRange(row1, 1, rowCnt, nCol).getValues();
  var colors = new Array(rowCnt);
  for (y = 0; y < rowCnt; y++) {
    colors[y] = new Array(nCol);
    for (var x = 0; x < nCol; x++) {
      colors[y][x] = "#ffffff";
    }
   
    var version = data[y][1];
    var custom = data[y][21];
    var stack = data[y][22];
    var comment = data[y][26];

    // key errors ORANGE
    if (custom.indexOf("key not found") > -1
        || custom.indexOf("wrong key") > -1) {
      colors[y][21] = "#ccaa22";
    }

    // failed update BLUE
    else if (custom.indexOf("update = fail") > -1) {
      colors[y][21] = "#2288cc";
    }                        

    // other errors RED
    else if (custom.indexOf("error") > 1
             && custom.indexOf("upload") == -1
             && custom.indexOf("registration") == -1) {
      colors[y][21] = "#cc2222";
    }                        
       
    // mark to be deleted rows
    if (data[y][0] == "" && stack == ""
        || comment == ""
        && version.indexOf("b") == -1 // keep beta
        && (version.indexOf(curVersion) == -1 || custom.indexOf("media prepare io") > 1) // keep current version
        && custom.indexOf("error") > -1 // error line
        && custom.indexOf("key not found") == -1 // keep this one
        && custom.indexOf("wrong key") == -1) { // keep this one
      colors[y][0] = "#663333";
    }

    // current version ORANGE
    if (data[y][1].indexOf(curVersion) > -1) {
      colors[y][1] = "#ccaa22";
    }                        

    // user comment RED
    if (data[y][26] != "") {
      colors[y][26] = "#cc2222";
    }
  }
 
  if (rowCnt > 0) {
    sheet.getRange(row1, 1, rowCnt, nCol).setBackgroundColors(colors);
  }
}

function hide()

{
  var sheet = SpreadsheetApp.getActiveSheet();
  var nRow = sheet.getLastRow()-1;
  var nCol = 28;
 
  var data = sheet.getRange(2, 1, nRow, nCol).getValues();
 
  for (var y = 0; y < nRow; y++) { 
    var custom = data[y][21];
   
    if ((custom.indexOf("upload") > -1 || custom.indexOf("registration") > -1)
        && custom.indexOf("error") == -1) {
      sheet.hideRows(y+2,1);
    }
  }
}


function show()

{
  var sheet = SpreadsheetApp.getActiveSheet();
  var nRow = sheet.getLastRow()-1;
  sheet.showRows(2,nRow);
}

Sebastiano Gottardo

unread,
Jun 22, 2011, 4:53:01 AM6/22/11
to acra-discuss
@mot12

thanks for sharing that, too. i'm gonna test it ASAP.

@kevin

we know that the graphics still sucks bad, but we wanted the
application's basics functionalities to be working. we are now working
on the missing filters and, after that, we can focus on giving a
better UI to the application.

please, any feedback is very welcome, so we know what features must be
improved and what must be modified!

Kevin Gaudin

unread,
Jun 22, 2011, 5:04:53 AM6/22/11
to acra-d...@googlegroups.com
Sebastiano,

I have played a few minutes with it, and this could be a very useful tool indeed :-)

I can't give you much more feedback for the moment as I didn't have enough time to use it on a real use case (and change a few column numbers to fit with my own reports).

No problem for the UI, it's clean enough for a dev tool imho. Priority on this kind of tool should definitely be put on features ;-) (but I agree with you, beign a dev tool is not a good reason for a bad UI)

Kevin

Sebastiano Gottardo

unread,
Jun 23, 2011, 6:51:08 AM6/23/11
to acra-discuss
Ok, thanks so much. We've added quite a lot of filters, which are
listed below. We have also turned our GitHub account into an
organization, but the link to the repository stays the same.

[*] PACKAGE_NAME - equals - anyvalue
[*] FILE_PATH - equals - anyvalue
[*] PHONE_MODEL - equals - anyvalue
[*] BOARD - equals - anyvalue
[*] BRAND - equals - anyvalue
[*] DEVICE - equals - anyvalue
[*] FINGERPRINT - equals - anyvalue
[*] HOST - equals - anyvalue
[*] ID - equals - anyvalue
[*] MODEL - equals - anyvalue
[*] PRODUCT - equals - anyvalue
[*] TAGS - equals - anyvalue
[*] TYPE - equals - anyvalue
[*] USER - equals - anyvalue
[*] CUSTOM - equals - anyvalue
[*] STACK_TRACE - equals - anyvalue
[*] INITIAL_CONFIGURATION - equals - anyvalue
[*] CRASH_CONFIGURATION - equals - anyvalue
[*] DISPLAY - equals - anyvalue
[*] USER_COMMENTS - equals - anyvalue

On 22 Giu, 11:04, Kevin Gaudin <kevin.gau...@gmail.com> wrote:
> Sebastiano,
>
> I have played a few minutes with it, and this could be a very useful tool
> indeed :-)
>
> I can't give you much more feedback for the moment as I didn't have enough
> time to use it on a real use case (and change a few column numbers to fit
> with my own reports).
>
> No problem for the UI, it's clean enough for a dev tool imho. Priority on
> this kind of tool should definitely be put on features ;-) (but I agree with
> you, beign a dev tool is not a good reason for a bad UI)
>
> Kevin
>

Philip Schiffer

unread,
Jun 28, 2011, 4:27:41 AM6/28/11
to acra-d...@googlegroups.com
Hi,
I have also started working on a Rails-based web app but due to my current work load at the university I haven't been able to finish a first alpha for this. If you're interested in this project you can check out https://github.com/hameno/ACRA-web-analytics and "Watch" it. Hopefully I will have more time for this when the current semester is over (which will be by the end of July).

You can also take a look at the current website http://acra.heroku.com, but it is a very early state and there is no guarantee that the data won't be purged from time to time when I do upgrades. There will also be a mobile client with push notification once it is finished.


Philip

Zoltan Fekete

unread,
Aug 30, 2011, 5:10:25 AM8/30/11
to acra-d...@googlegroups.com
Sebastiano,

Thanks for this java implementation of the Report Viewer. It's great on old spredsheet (ACRA 3) but on the new ones the something is wrong with the GUI as the log viewer part is sized all over the window, so it is unusable. 

I need a tool like this badly, since I have passed the google docs limit, I can't download my report (it over 900 reports inside the spredsheet) and also viewing it in the google spredsheet interface is impossible (crashes the browser, probably becouse the spredsheet is more that 30 mb in size by now). Your app works but the GUI don't let me view the reports....

Best regards, 
Z.

DextoR

unread,
Aug 30, 2011, 5:14:56 AM8/30/11
to acra-d...@googlegroups.com
Hi Zoltan,

I'm sorry for this incompatibility. Can you populate a spreadsheet for test purposes and share it with me? So I can see myself what the problem is. I can't promise that I will be able to solve this issue immediately since I'm also busy with university and business projects, but I can try.

BR,
Sebastiano

2011/8/30 Zoltan Fekete <zol...@gmail.com>

MarMor

unread,
Oct 25, 2011, 7:54:00 AM10/25/11
to acra-d...@googlegroups.com
Hi Sabastian,
Thanks for the project, seems just want I need, but it seems incompatible with my spreadsheet...

I'm using ACRA's customReportContent with the following fields: 
{ REPORT_ID, APP_VERSION_CODE, APP_VERSION_NAME, PHONE_MODEL, BRAND, PRODUCT, ANDROID_VERSION, BUILD,
AVAILABLE_MEM_SIZE, STACK_TRACE, CRASH_CONFIGURATION, DISPLAY, USER_COMMENT, USER_EMAIL,
USER_APP_START_DATE, USER_CRASH_DATE, DEVICE_FEATURES, SHARED_PREFERENCES,
SETTINGS_SYSTEM, }

And when running it gets stuck in "Loading worksheet contents.." while a thread crashes with:
Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 27
at java.util.Vector.get(Unknown Source)
at LogTracker_GUI.updateLogList(LogTracker_GUI.java:668)
at LogTracker_GUI$5.run(LogTracker_GUI.java:429)

I'll be looking a bit later at the code, see if I can spot the bug, but what comes to mind is that you assume default fields in spreadsheet while I've set custom fields.

Thanks,
Mor.

DextoR

unread,
Oct 25, 2011, 7:57:33 AM10/25/11
to acra-d...@googlegroups.com
This may be the exact reason for the crashes you are experiencing. Please, keep in mind that I didn't have time to update the project to the latest ACRA 4 version, so some fix is needed. I can help you with that, if you want.

2011/10/25 MarMor <gaz...@gmail.com>

MarMor

unread,
Oct 25, 2011, 8:14:19 AM10/25/11
to acra-d...@googlegroups.com
Yep, read the code a bit...
and hacked a temp. solution to my problem my manually modifying the values in ColNamesAssoc to fit my spreadsheet.
I then had to catch exceptions because your code assumes all fields exist in the spreadsheet, so added try-catch to every writeAppLog couple:
try {
writeAppLog("K",...
writeAppLog("O",...
} catch (ArrayIndexOutOfBoundsException e) {
} catch (NullPointerException e) {
}

and it seems to work well now (except the refresh button which I currently don't need).

I was looking for something that will merge similar exceptions for me, like google does in their developer console... 
If i'll have some time to develop it for your project i'd be happy to send your the code (i'm tight on time, so not sure i'll get to it...)

Thanks,
Mor.

DextoR

unread,
Oct 26, 2011, 6:11:46 AM10/26/11
to acra-d...@googlegroups.com
I'm sorry that my code is not that extensible, but at that time my team was needing for a fast and easy solution, and that is what came out.
I would be more than happy to integrate your code to improve the tracker. Unfortunately my time is as tight as yours, so I cannot promise anything right now :)

2011/10/25 MarMor <gaz...@gmail.com>
Reply all
Reply to author
Forward
0 new messages