【问题标题】:Is it possible to log the output of the Scala REPL?是否可以记录 Scala REPL 的输出?
【发布时间】:2012-08-08 20:00:17
【问题描述】:

有没有办法将 Scala REPL 的输出记录到文件中?

【问题讨论】:

标签: scala logging read-eval-print-loop


【解决方案1】:

您可以导入 java.util.PrintWriter 并编写如下代码:

val out = new PrintWriter("out.txt")
out.println("output string")
out.flush();
out.close();

【讨论】:

  • 它是 java.io.PrintWriter
猜你喜欢
  • 2014-08-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-29
  • 1970-01-01
  • 1970-01-01
  • 2011-05-06
相关资源
最近更新 更多