B4J Tutorial [B4X] ErrorAnalyzer -Turn Error Logs Into a Call History with Actual B4X Source Line Numbers and Text

Recently I have been looking at #Macros, and then a few days ago there was a post about error reports.
It occurred to me that a faster way to find the source of errors is possible.
Introducing "errorAnalyzer"...

1. Add errorAnalyzer.jar to your Additional folder

2. Add this macro to your project (Main or B4XMainPage). This will add a button to the top of the IDE.
#Macro: Title, Error Analyzer, ide://run?File=%ADDITIONAL%\errorAnalyzer.jar&Args=%PROJECT%

3. When an error occurs and you want to see the calling history of the error:
Just copy all from the log, errorAnalyzer will find the error at the end of the Log.

4. Invoke errorAnalyzer by clicking on the button at top of IDE (or type its shortcut).

5. Paste the contents of the clipboard to the designated area. Press Ready.

6. You'll see the details of the calling history

7. Press X to exit, or Copy to Clipboard. Paste the results at the END OF ANY MODULE (so line numbers aren't changed).

8. Use the included IDE Ctrl Click GoTo links to quickly go to source of error.


ErrorLog.jpg
initialScreen.jpg
afterPaste.jpg
resultScreen.jpg
pasteResults.jpg


The .jar is too large to upload. So here is a Drop Box link
https://www.dropbox.com/scl/fi/fkos...ey=osr7vjj0shc3710qjdbm01ogg&st=tgyfzpsd&dl=0

The jar file is inside the zipped folder EAnalyzer.zip
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Nice! This should be built-in to the IDE...
I agree. But after putting the .jar in Additional..
the IDE will take care of the rest with this Macro, it adds a button to the top header of the IDE.

#Macro: Title, Error Analyzer, ide://run?File=%ADDITIONAL%\errorAnalyzer.jar&Args=%PROJECT%

I am still testing various situations: it works in Release or Debug mode.
I'll look at console apps in B4J and test with B4A.

In future posts I will provide source code and an explanation of how it works.
 

William Lancee

Well-Known Member
Licensed User
Longtime User
It works in B4A in both Release and Debug mode.
In B4J console mode it misses a stack level. I'll look at it tomorrow.
 
Top