Android Question Clearing the B4A Logs Pane (Using B4A-Bridge)

Guardian17

Active Member
Licensed User
Longtime User
I have been experimenting with ways to fully clear the B4A log pane between runs of a program (using B4A-Bridge), as it becomes confusing sometimes trying to distinguish where a new Run starts.

Things I have tried, without success:
  • Simply pressing the "Clear" button at the bottom of the Logs pane clears the current pane only. The previous logs will re-appear above any new log information on any subsequent compile/run of your program. [What, then, is the purpose of "Clear"?]
  • Exiting and re-starting the B4A IDE on your computer does not reset the Logs.

So, what else is there to try?
It appears that each individual "Project \ Build Configurations 'Package'" name causes a separate App Instance to be placed on your Device (i.e.: if you access your installed "Apps" on your Device, you will see a separate icon for each of the "Package" configurations that you have installed).

There is a separate log kept for each one of these App Instances. As such, if you create a NEW "Project \ Build Configurations Package", when you then compile and run the App, a new App Instance will be installed on your Device, and the log for that App will appear fresh and new. However, subsequent re-compile/runs will ADD to that App Instance's log.

The only way I've found to reliably totally clear any already-existing App's log, which can be tedious and may be time-consuming depending on the age of your Device, is to restart your Device. Then all logs for all App Instances will be reset as a clean slate (at least on my Galaxy S7 Device).

Another way to distinguish and separate new runs of your program in your running log, without clearing the Log Pane, is to put blank "Log" or "LogColor" statements in Activity_Create for FirstTime=True:
B4X:
   If FirstTime = True Then
       Log(" ")
       Log(" ")
       Log(" ")
       Log(" ")
       LogColor("+++++++ Running Activity_Create First Time +++++++",Colors.Magenta)
       'Other First-Time Code
 End If

Hope this helps.
 
Last edited:
Top