Android Question LogCat in Phone Library - optional arguments

Similar threads

B4A Code Snippet Parsing your apps logs
Other B4A v5.80 BETA is released!
B4A Question Phone LogCat
B4A Tutorial Android JSON tutorial
B4A Tutorial [B4X] Comment Links

pfhrr

Member
Licensed User
How do I pass optional arguments, when using LogCat?
https://developer.android.com/studio/command-line/logcat
In particular Filtering log output

Sub Process_Globals
Dim logger As LogCat
Dim args(1) As String

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Phone_tester")
logger.LogCatStart(args,"MyLogCatName")


Sub MyLogCatName_LogCatData(Buffer() As Byte, Length As Int)
Dim data As String
data = BytesToString(Buffer,0,Length,"UTF-8")
 

Erel

Administrator
Staff member
Licensed User
Please use [code]code here...[/code] tags when posting code.

Starting logcat from Activity_Create, without checking that FirstTime is True, is a mistake. Worth watching the life cycle video tutorial: https://www.b4x.com/etp.html

Example of a filter that keeps all B4A tagged messages and all fatal level messages:
B4X:
Dim args() As String = Regex.Split(",", "-v,raw,*:F,B4A:v")
 
Top