[英]How to log into a string? Is there a way to capture every console output into a single string?
我使用java.util.logging Logger class,我想捕獲控制台上的所有消息(不僅僅是日志)並將它們放在一個字符串中(我稍后會在其他地方使用)。 我確實找到了一個 class ,它從System.out捕獲println -s,但是日志 go 到System.err所以我必須以某 ...