When I run an app on the Android Emulator, or, on a physical device, the logs are huge, and often overwhelming... I wanted to know how to get only relevant output and, not unnecessary logs like this one:
W/om.tejas.pethu( 7618): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (greylist, reflection, allowed)
I/ProviderInstaller( 7618): Installed default security provider GmsCore_OpenSSL
W/om.tejas.pethu( 7618): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (greylist, reflection, allowed)
W/om.tejas.pethu( 7618): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, linking, allowed)
W/om.tejas.pethu( 7618): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, linking, allowed)
W/om.tejas.pethu( 7618): Accessing hidden field Ljava/io/FileDescriptor;->descriptor:I (greylist, JNI, allowed)
W/om.tejas.pethu( 7618): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (greylist, reflection, allowed)
W/om.tejas.pethu( 7618): Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (greylist,core-platform-api, linking, allowed)
W/om.tejas.pethu( 7618): Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (greylist, linking, allowed)
Keep in mind, that huge amounts of verbose logs get produced during runtime... This makes it very hard to find what logs are verbose and unnecessary and what logs you expect to see like print('Hello');.
Mind you, looking for this Hello string in verbose logs like the above one can be challenging to say the least.
This is in comparison with iOS Logs, which are clean and non verbose:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Xcode build done. 33.6s
Configuring the default Firebase app...
Configured the default Firebase app __FIRAPP_DEFAULT.
Connecting to VM Service at ws://127.0.0.1:54149/6CwtGLU6Ci0=/ws
It is worth noting that, during runtime, only important logs/necessary ones are displayed like Dart compiler errors and print statements.
What I am asking is :
Is there any way to filter these logs so that I only get the print statements and errors produced by the Dart/Flutter compiler?
If not possible, is there any way to stop these logs in a non-hacky way? I would prefer not to go into any of the complex source code which has been written for us behind the scenes...
flutter run -d <device-id> yields the same excess logs if not more than the above :
An Observatory debugger and profiler on sdk gphone x86 arm is available at:
http://127.0.0.1:55302/9hN29j0-dRE=/
W/DynamiteModule( 7842): Local module descriptor class for providerinstaller not found.
I/DynamiteModule( 7842): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller( 7842): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
I/TetheringManager( 7842): registerTetheringEventCallback:com.tejas.pethub
I/om.tejas.pethu( 7842): The ClassLoaderContext is a special shared library.
I/om.tejas.pethu( 7842): Waiting for a blocking GC ProfileSaver
I/om.tejas.pethu( 7842): The ClassLoaderContext is a special shared library.
I/om.tejas.pethu( 7842): The ClassLoaderContext is a special shared library.
V/NativeCrypto( 7842): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 286 native methods...
W/om.tejas.pethu( 7842): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (greylist, reflection, allowed)
I/ProviderInstaller( 7842): Installed default security provider GmsCore_OpenSSL
W/om.tejas.pethu( 7842): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (greylist, reflection, allowed)
W/om.tejas.pethu( 7842): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, linking, allowed)
W/om.tejas.pethu( 7842): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, linking, allowed)
W/om.tejas.pethu( 7842): Accessing hidden field Ljava/io/FileDescriptor;->descriptor:I (greylist, JNI, allowed)
W/om.tejas.pethu( 7842): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (greylist, reflection, allowed)
W/om.tejas.pethu( 7842): Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (greylist,core-platform-api, linking, allowed)
W/om.tejas.pethu( 7842): Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (greylist, linking, allowed)
Thanks for any help I receive from you and I appreciate it!