Rust stdout无法在Java应用程序中打印

问题描述

我正在为程序的GUI使用一个android Java应用程序,并且正在尝试调试该GUI的较低级的rust内核。尽管stdout在Java端起作用,但是从rust端发出的任何printlns都不会显示在控制台(android studio)中。我在生锈的FFI上使用JNI-RS。这是预期的行为吗?如何缓解该问题(不打印文件)?

解决方法

对于Android,您必须使用logcat而不是stdout(更多详细信息herethere)。一种可能的方法是使用android_logger或任何其他提供logcat支持的板条箱。

您可以找到有关stdout重定向there的更多信息。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...