prefer scala.Console with its support for thread-local redirection;
authorwenzelm
Fri May 02 20:01:45 2014 +0200 (2014-05-02)
changeset 56831e3ccf0809d51
parent 56830 e760242101fc
child 56832 93f05fa757dd
prefer scala.Console with its support for thread-local redirection;
src/Pure/General/output.scala
src/Pure/System/isabelle_process.scala
src/Pure/System/options.scala
src/Pure/Tools/build.scala
src/Pure/Tools/doc.scala
     1.1 --- a/src/Pure/General/output.scala	Fri May 02 19:51:40 2014 +0200
     1.2 +++ b/src/Pure/General/output.scala	Fri May 02 20:01:45 2014 +0200
     1.3 @@ -12,8 +12,8 @@
     1.4    def warning_text(msg: String): String = cat_lines(split_lines(msg).map("### " + _))
     1.5    def error_text(msg: String): String = cat_lines(split_lines(msg).map("*** " + _))
     1.6  
     1.7 -  def writeln(msg: String) { System.err.println(msg) }
     1.8 -  def warning(msg: String) { System.err.println(warning_text(msg)) }
     1.9 -  def error_message(msg: String) { System.err.println(error_text(msg)) }
    1.10 +  def writeln(msg: String) { Console.err.println(msg) }
    1.11 +  def warning(msg: String) { Console.err.println(warning_text(msg)) }
    1.12 +  def error_message(msg: String) { Console.err.println(error_text(msg)) }
    1.13  }
    1.14  
     2.1 --- a/src/Pure/System/isabelle_process.scala	Fri May 02 19:51:40 2014 +0200
     2.2 +++ b/src/Pure/System/isabelle_process.scala	Fri May 02 20:01:45 2014 +0200
     2.3 @@ -12,7 +12,7 @@
     2.4  
     2.5  
     2.6  class Isabelle_Process(
     2.7 -  receiver: Prover.Message => Unit = System.out.println(_),
     2.8 +  receiver: Prover.Message => Unit = Console.println(_),
     2.9    prover_args: List[String] = Nil)
    2.10  {
    2.11    /* text and tree data */
     3.1 --- a/src/Pure/System/options.scala	Fri May 02 19:51:40 2014 +0200
     3.2 +++ b/src/Pure/System/options.scala	Fri May 02 20:01:45 2014 +0200
     3.3 @@ -147,13 +147,13 @@
     3.4            val options = (Options.init() /: more_options)(_ + _)
     3.5  
     3.6            if (get_option != "")
     3.7 -            System.out.println(options.check_name(get_option).value)
     3.8 +            Console.println(options.check_name(get_option).value)
     3.9  
    3.10            if (export_file != "")
    3.11              File.write(Path.explode(export_file), YXML.string_of_body(options.encode))
    3.12  
    3.13            if (get_option == "" && export_file == "")
    3.14 -            System.out.println(options.print)
    3.15 +            Console.println(options.print)
    3.16  
    3.17          case _ => error("Bad arguments:\n" + cat_lines(args))
    3.18        }
     4.1 --- a/src/Pure/Tools/build.scala	Fri May 02 19:51:40 2014 +0200
     4.2 +++ b/src/Pure/Tools/build.scala	Fri May 02 20:01:45 2014 +0200
     4.3 @@ -32,7 +32,7 @@
     4.4  
     4.5    class Console_Progress(verbose: Boolean) extends Progress
     4.6    {
     4.7 -    override def echo(msg: String) { System.out.println(msg) }
     4.8 +    override def echo(msg: String) { Console.println(msg) }
     4.9      override def theory(session: String, theory: String): Unit =
    4.10        if (verbose) echo(session + ": theory " + theory)
    4.11  
     5.1 --- a/src/Pure/Tools/doc.scala	Fri May 02 19:51:40 2014 +0200
     5.2 +++ b/src/Pure/Tools/doc.scala	Fri May 02 20:01:45 2014 +0200
     5.3 @@ -77,7 +77,7 @@
     5.4  
     5.5    def view(path: Path)
     5.6    {
     5.7 -    if (path.is_file) System.out.println(Library.trim_line(File.read(path)))
     5.8 +    if (path.is_file) Console.println(Library.trim_line(File.read(path)))
     5.9      else {
    5.10        val pdf = path.ext("pdf")
    5.11        if (pdf.is_file) Isabelle_System.pdf_viewer(pdf)
    5.12 @@ -92,7 +92,7 @@
    5.13    {
    5.14      Command_Line.tool0 {
    5.15        val entries = contents()
    5.16 -      if (args.isEmpty) System.out.println(cat_lines(contents_lines().map(_._2)))
    5.17 +      if (args.isEmpty) Console.println(cat_lines(contents_lines().map(_._2)))
    5.18        else {
    5.19          args.foreach(arg =>
    5.20            entries.collectFirst { case Doc(name, _, path) if arg == name => path } match {