src/Pure/General/output.scala
changeset 65828 02dd430d80c5
parent 64370 865b39487b5d
child 67178 70576478bda9
equal deleted inserted replaced
65827:3bba3856b56c 65828:02dd430d80c5
    12   def clean_yxml(msg: String): String =
    12   def clean_yxml(msg: String): String =
    13     try { XML.content(Protocol_Message.clean_reports(YXML.parse_body(msg))) }
    13     try { XML.content(Protocol_Message.clean_reports(YXML.parse_body(msg))) }
    14     catch { case ERROR(_) => msg }
    14     catch { case ERROR(_) => msg }
    15 
    15 
    16   def writeln_text(msg: String): String = clean_yxml(msg)
    16   def writeln_text(msg: String): String = clean_yxml(msg)
    17   def warning_text(msg: String): String = cat_lines(split_lines(clean_yxml(msg)).map("### " + _))
    17 
    18   def error_text(msg: String): String = cat_lines(split_lines(clean_yxml(msg)).map("*** " + _))
    18   def warning_text(msg: String): String =
       
    19     cat_lines(split_lines(clean_yxml(msg)).map("### " + _))
       
    20 
       
    21   def error_message_text(msg: String): String =
       
    22     cat_lines(split_lines(clean_yxml(msg)).map("*** " + _))
    19 
    23 
    20   def writeln(msg: String, stdout: Boolean = false)
    24   def writeln(msg: String, stdout: Boolean = false)
    21   {
    25   {
    22     if (msg != "") {
    26     if (msg != "") {
    23       if (stdout) Console.println(writeln_text(msg))
    27       if (stdout) Console.println(writeln_text(msg))
    34   }
    38   }
    35 
    39 
    36   def error_message(msg: String, stdout: Boolean = false)
    40   def error_message(msg: String, stdout: Boolean = false)
    37   {
    41   {
    38     if (msg != "") {
    42     if (msg != "") {
    39       if (stdout) Console.println(error_text(msg))
    43       if (stdout) Console.println(error_message_text(msg))
    40       else Console.err.println(error_text(msg))
    44       else Console.err.println(error_message_text(msg))
    41     }
    45     }
    42   }
    46   }
    43 }
    47 }