以编程方式访问 Java 控制台日志
是否可以,如果可以,如何以编程方式访问 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
System.setOut
和setErr
您可以捕获原本会发送到控制台的输出。Using
System.setOut
andsetErr
you can capture output that would otherwise go to the console.您可以将日志消息附加到 StringBuffer 对象,并通过单击按钮在文本字段中显示。
You can append log messages to a StringBuffer object, and show in Textfield on the click of a button.