-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Event Detail]: Attachment preview for Android logcat output #61005
Comments
Here is a sample log file: --------- beginning of crash
12-02 00:38:12.756 12112 12112 E AndroidRuntime: FATAL EXCEPTION: main
12-02 00:38:12.756 12112 12112 E AndroidRuntime: Process: com.NotYetMedia.RoyalRoad, PID: 12112
12-02 00:38:12.756 12112 12112 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.NotYetMedia.RoyalRoad/crc64d22d936ca88f8d15.MainActivity}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3433)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3607)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2068)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.os.Looper.loop(Looper.java:223)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7680)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:423)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at androidx.fragment.app.FragmentManager.checkStateLoss(SourceFile:12)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at androidx.fragment.app.FragmentManager.enqueueAction(SourceFile:27)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at androidx.fragment.app.BackStackRecord.commitInternal(SourceFile:70)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at androidx.fragment.app.BackStackRecord.commit(SourceFile:2)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at crc64d22d936ca88f8d15.MainActivity.n_onCreate(Native Method)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at crc64d22d936ca88f8d15.MainActivity.onCreate(SourceFile:1)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7994)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7978)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1548)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3406)
12-02 00:38:12.756 12112 12112 E AndroidRuntime: ... 12 more
--------- beginning of main
12-02 00:43:48.016 13292 13292 I SentryExecutorS: type=1400 audit(0.0:1908): avc: denied { write } for name="deleted" dev="vda11" ino=10733 scontext=u:r:untrusted_app:s0:c168,c256,c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=1 app=com.NotYetMedia.RoyalRoad
12-02 00:43:48.016 13292 13292 I SentryExecutorS: type=1400 audit(0.0:1909): avc: denied { add_name } for name="breadcrumbs.json" dev="vda11" ino=6146 scontext=u:r:untrusted_app:s0:c168,c256,c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=1 app=com.NotYetMedia.RoyalRoad
12-02 00:43:48.239 13292 13292 I Media.RoyalRoa: Explicit concurrent copying GC freed 1829(143KB) AllocSpace objects, 4(80KB) LOS objects, 24% free, 5016KB/6688KB, paused 40us total 22.044ms
12-02 00:43:48.370 13292 13292 I Media.RoyalRoa: Explicit concurrent copying GC freed 680(58KB) AllocSpace objects, 0(0B) LOS objects, 24% free, 4973KB/6631KB, paused 36us total 23.083ms So the standard format is basically
and multi-line messages have this header on each line. Some lines may begin with a series of hyphens to signify a separator, these should probably be unparsed. Levels are:
Managed C# stack traces from .NET Android follow mostly the same format as Java stacktraces with the exception that they have the arguments instead of the file and line number: Java: 12-02 00:43:49.770 13292 13292 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.NotYetMedia.RoyalRoad/crc64d22d936ca88f8d15.MainActivity}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
12-02 00:43:49.770 13292 13292 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3433)
12-02 00:43:49.770 13292 13292 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3607)
12-02 00:43:49.770 13292 13292 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
12-02 00:43:49.770 13292 13292 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) C#: 12-02 00:43:49.864 13292 13292 I MonoDroid: Java.Lang.RuntimeException: Unable to start activity ComponentInfo{com.NotYetMedia.RoyalRoad/crc64d22d936ca88f8d15.MainActivity}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
12-02 00:43:49.864 13292 13292 I MonoDroid: ---> Java.Lang.IllegalStateException: Can not perform this action after onSaveInstanceState
12-02 00:43:49.864 13292 13292 I MonoDroid: at Java.Interop.JniEnvironment.InstanceMethods.CallIntMethod(JniObjectReference , JniMethodInfo , JniArgumentValue* )
12-02 00:43:49.865 13292 13292 I MonoDroid: at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeAbstractInt32Method(String , IJavaPeerable , JniArgumentValue* )
12-02 00:43:49.865 13292 13292 I MonoDroid: at AndroidX.Fragment.App.FragmentTransactionInvoker.Commit()
12-02 00:43:49.865 13292 13292 I MonoDroid: at Microsoft.Maui.Platform.NavigationRootManager.SetContentView(IView view) so it's also possible to highlight lines with stacktrace lines via
where |
Routing to @getsentry/product-owners-issues for triage ⏲️ |
Events from Android can send device logcat logs as attachments.
The current preview format shows it as standard text. We'd like to be able to see the logs in a more user friendly way.
For example, with process/ priority and timestamp filter, coloring, etc.
For example, the logcat window inside Android Studio:
Solution brainstorming
Add to the current handlers one called
text/logcat
:sentry/static/app/components/events/eventAttachments.tsx
Lines 38 to 56 in d4f5584
Use an npm library that parses the output to display the preview with field on top.
More context on this PR/thread: getsentry/sentry-dotnet#2926 (comment)
The text was updated successfully, but these errors were encountered: