src/Pure/Tools/build_log.scala
changeset 64083 fef1a0a59c12
parent 64082 d57c7295f601
child 64085 1c451e5c145f
equal deleted inserted replaced
64082:d57c7295f601 64083:fef1a0a59c12
    49 
    49 
    50   /** log file **/
    50   /** log file **/
    51 
    51 
    52   object Log_File
    52   object Log_File
    53   {
    53   {
       
    54     def apply(path: Path): Log_File =
       
    55     {
       
    56       val (path_name, ext) = path.expand.split_ext
       
    57       val text =
       
    58         if (ext == "gz") File.read_gzip(path)
       
    59         else if (ext == "xz") File.read_xz(path)
       
    60         else File.read(path)
       
    61       apply(path_name.base.implode, text)
       
    62     }
       
    63 
    54     def apply(name: String, lines: List[String]): Log_File =
    64     def apply(name: String, lines: List[String]): Log_File =
    55       new Log_File(name, lines)
    65       new Log_File(name, lines)
    56 
    66 
    57     def apply(name: String, text: String): Log_File =
    67     def apply(name: String, text: String): Log_File =
    58       Log_File(name, Library.trim_split_lines(text))
    68       Log_File(name, Library.trim_split_lines(text))