0

When I start my application I have Logcat output like this:

2022-10-18 16:27:52.980 24750-24750 balsystem.rflo          my.application.package                I  The ClassLoaderContext is a special shared library.
2022-10-18 16:27:53.313 24750-24750 NetworkSecurityConfig   my.application.package                D  No Network Security Config specified, using platform default
2022-10-18 16:27:53.313 24750-24750 NetworkSecurityConfig   my.application.package                D  No Network Security Config specified, using platform default
2022-10-18 16:27:53.352 24750-24775 libEGL                  my.application.package                D  loaded /vendor/lib64/egl/libEGL_emulation.so
2022-10-18 16:27:53.361 24750-24775 libEGL                  my.application.package                D  loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2022-10-18 16:27:53.366 24750-24775 libEGL                  my.application.package                D  loaded /vendor/lib64/egl/libGLESv2_emulation.so
2022-10-18 16:27:53.420 24750-24750 DeviceInfo              my.application.package                D  cw.model:
2022-10-18 16:27:53.434 24750-24750 DeviceAPI_DeviceCon     my.application.package                I  getDeviceInfoFromFile configPath=/storage/emulated/0/PDAConfig.txt
2022-10-18 16:27:53.434 24750-24750 DeviceAPI_DeviceCon     my.application.package                D  cw.model2:
2022-10-18 16:27:53.434 24750-24750 DeviceAPI_DeviceCon     my.application.package                D  cw.model:
2022-10-18 16:27:53.434 24750-24750 DeviceAPI_DeviceCon     my.application.package                D  最终cw.model:
2022-10-18 16:27:53.435 24750-24750 DeviceAPI_DeviceCon     my.application.package                I  model=C4000_6735,uartPath=/dev/ttyMT3,uartPath_Fingerprint=/dev/ttyMT0,uartPath_RFID=,uartPath_UHF=
2022-10-18 16:27:53.435 24750-24750 DeviceAPI_DeviceCon     my.application.package                I  getModel() model=C4000_6735
2022-10-18 16:27:53.957 24750-24766 System                  my.application.package                W  A resource failed to call close. 
2022-10-18 16:27:54.201 24750-24750 balsystem.rflo          my.application.package                W  Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2022-10-18 16:27:54.202 24750-24750 balsystem.rflo          my.application.package                W  Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2022-10-18 16:27:54.311 24750-24779 RfidInitTask            my.application.package                E  Can't initialize RFID receiver. Unsupported device architecture.
2022-10-18 16:27:54.373 24750-24773 HostConnection          my.application.package                D  HostConnection::get() New Host Connection established 0x7c1d30a33090, tid 24773
2022-10-18 16:27:54.379 24750-24773 HostConnection          my.application.package                D  HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2022-10-18 16:27:54.398 24750-24773 EGL_emulation           my.application.package                D  eglCreateContext: 0x7c1d20a40570: maj 3 min 0 rcv 3
2022-10-18 16:27:54.400 24750-24773 EGL_emulation           my.application.package                D  eglMakeCurrent: 0x7c1d20a40570: ver 3 0 (tinfo 0x7c1cc0a57f70) (first time)
2022-10-18 16:27:54.412 24750-24773 Gralloc4                my.application.package                I  mapper 4.x is not supported
2022-10-18 16:27:54.413 24750-24773 HostConnection          my.application.package                D  createUnique: call
2022-10-18 16:27:54.413 24750-24773 HostConnection          my.application.package                D  HostConnection::get() New Host Connection established 0x7c1d30a33450, tid 24773
2022-10-18 16:27:54.414 24750-24773 goldfish-address-space  my.application.package                D  allocate: Ask for block of size 0x100
2022-10-18 16:27:54.414 24750-24773 goldfish-address-space  my.application.package                D  allocate: ioctl allocate returned offset 0x3f3ffe000 size 0x2000
2022-10-18 16:27:54.419 24750-24773 HostConnection          my.application.package                D  HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2022-10-18 16:27:55.223 24750-24773 OpenGLRenderer          my.application.package                I  Davey! duration=929ms; Flags=1, IntendedVsync=303506544936174, Vsync=303506578269506, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=303506594370060, AnimationStart=303506594397860, PerformTraversalsStart=303506594435660, DrawStart=303507175458860, SyncQueued=303507194647860, SyncStart=303507195686260, IssueDrawCommandsStart=303507196099160, SwapBuffers=303507466346960, FrameCompleted=303507475060360, DequeueBufferDuration=311600, QueueBufferDuration=3495300, GpuCompleted=0, 
2022-10-18 16:27:55.253 24750-24750 Compatibil...geReporter my.application.package                D  Compat change id reported: 147798919; UID 10130; state: ENABLED
2022-10-18 16:27:55.282 24750-24750 Choreographer           my.application.package                I  Skipped 56 frames!  The application may be doing too much work on its main thread.
2022-10-18 16:27:55.318 24750-24773 OpenGLRenderer          my.application.package                I  Davey! duration=973ms; Flags=0, IntendedVsync=303506594955740, Vsync=303507528289036, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=303507533739560, AnimationStart=303507533766260, PerformTraversalsStart=303507534047260, DrawStart=303507534280860, SyncQueued=303507534453360, SyncStart=303507536769560, IssueDrawCommandsStart=303507536927060, SwapBuffers=303507538122060, FrameCompleted=303507570382460, DequeueBufferDuration=14900600, QueueBufferDuration=7243300, GpuCompleted=0, 

Some of these logs come out from Retrofit, some from drawing, some from Android emulator drivers i guess. All of them appear like owned by my.application.package.

Can I silence of filter out them (or most of them) quickly to get only logs from my project classes without typing all relevant classes in logcat filter?

Only idea that I have at this moment to "mark" my classes with some TAG prefix, but maybe there is better solution?

Kamil
  • 13,363
  • 24
  • 88
  • 183
  • TAG prefix is not such a bad idea. work manager library does exactly that. They use `WM-` prefix, followed by a lots of tags (class names in their case). – Shlomi Katriel Oct 18 '22 at 16:09

1 Answers1

0

For now I put something like this in my all classes:

private val TAG = "Cl-" + this.javaClass.simpleName

Previously I had this:

private val TAG = this.javaClass.simpleName
Kamil
  • 13,363
  • 24
  • 88
  • 183