以编程方式访问 Java 控制台日志

发布于 2024-12-11 01:03:33 字数 150 浏览 2 评论 0原文

是否可以,如果可以,如何以编程方式访问 Java 小程序生成的 Java 控制台日志?

我想做的是向我正在开发的小程序添加一个“发布错误”按钮。当测试人员单击此按钮时,我希望小程序将控制台日志的内容打包为小程序提交的错误报告的一部分。

感谢您的任何帮助。

Is it possible to, and if so how do you get programmatic access to the Java Console Log generated by Java applets?

What I want to do is add a "post bug" button to the applet I am developing. When testers click this button I would like the applet to then package up the contents of the console log as part of a bug report submitted by the applet.

Thanks for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嗫嚅 2024-12-18 01:03:33

使用 System.setOutsetErr 您可以捕获原本会发送到控制台的输出。

Using System.setOut and setErr you can capture output that would otherwise go to the console.

∞琼窗梦回ˉ 2024-12-18 01:03:33

您可以将日志消息附加到 StringBuffer 对象,并通过单击按钮在文本字段中显示。

You can append log messages to a StringBuffer object, and show in Textfield on the click of a button.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文