Android:通过 ACRA 在 logcat 中包含时间戳
Android: Include Timestamps in logcat via ACRA
我正在使用以下 ACRA 配置在我的应用程序崩溃时向我发送电子邮件:
@ReportsCrashes(formKey = "", // will not be used
mailTo = "myaddress@gmail.com", // my email here
customReportContent = {ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.STACK_TRACE, ReportField.LOGCAT },
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text,
logcatArguments = { "-t", "1000", "myapp*:V" }
)
这将向我发送一封包含所有 logcat 文本输出的电子邮件,但我如何包含 Logcat 中显示的时间字段?
我已经尝试将 "time" 添加到 logcat 参数中,但这根本没有任何作用。
我可以修改输出文本的内容以包括时间,但这对我可能感兴趣的其他系统事件没有帮助。
我明白了。我也需要“-v”。这有效:
logcatArguments = { "-v", "time", "-t", "1000", "myapp*:V" }
我正在使用以下 ACRA 配置在我的应用程序崩溃时向我发送电子邮件:
@ReportsCrashes(formKey = "", // will not be used
mailTo = "myaddress@gmail.com", // my email here
customReportContent = {ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.STACK_TRACE, ReportField.LOGCAT },
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text,
logcatArguments = { "-t", "1000", "myapp*:V" }
)
这将向我发送一封包含所有 logcat 文本输出的电子邮件,但我如何包含 Logcat 中显示的时间字段?
我已经尝试将 "time" 添加到 logcat 参数中,但这根本没有任何作用。
我可以修改输出文本的内容以包括时间,但这对我可能感兴趣的其他系统事件没有帮助。
我明白了。我也需要“-v”。这有效:
logcatArguments = { "-v", "time", "-t", "1000", "myapp*:V" }