如何恢复协程的真实通话记录? [英] How to recover the coroutine's true call trace?

查看:74
本文介绍了如何恢复协程的真实通话记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于使用异步API的任何人来说,这都是一个痛苦的熟悉的问题:当您的调用遇到故障时,异步库的私有线程会检测到它,创建一个异常对象,并将其传递给您的回调.值得一毛钱的唯一信息是该消息中的消息,可能还有它的类型.堆栈跟踪毫无价值.

This is a painfully familiar problem to anyone working with async APIs: when your call encounters a failure, the async library's private thread detects it, creates an exception object, and passes it to your callback. The only info worth a dime in that exception is its message and possibly its type. The stack trace is worthless.

与Google Play报告应用程序崩溃的方式杂交:消息被剥离,而您得到的只是堆栈跟踪.现在,您已一无所有.您只知道您的应用程序存在您在自己的测试中未检测到的错误.

Cross-breed that with Google Play's way of reporting the app crashes: the message is stripped and all you get is the stack trace. Now you've got nothing to go with. You just know your app has a bug that you didn't detect in your own testing.

科特琳的协程至少给了我们一些希望可以做得更好.协程堆栈跟踪在概念上在那里,只是很难提取.但是,目前,我们得到的堆栈跟踪与我上面描述的相同,没有用.

Kotlin's coroutines at least give us some hope that this could be made better. The coroutine stack trace is conceptually there, just difficult to extract. However, currently the stack traces we get are the same, useless ones I described above.

我熟悉 kotlinx-coroutines-debug 模块,我看到在实现方面有一些规定可以重新创建协程堆栈跟踪,但是如何在用户智能手机上安装的生产应用程序中利用这些功能呢?

I'm familiar with the kotlinx-coroutines-debug module and I see there are some provisions on the implementation side to recreate the coroutine stack trace, but how can I make use of these facilities in a production app installed on my user's smartphone?

推荐答案

首先,所有功能都是

First off all the feature is broken at the moment. If the bug is fixed I would try System.setProperty(DEBUG_PROPERTY_NAME,DEBUG_PROPERTY_VALUE_ON).

这篇关于如何恢复协程的真实通话记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆