src/Pure/Tools/build_log.scala
changeset 64150 b10f2ddd7679
parent 64120 6c5039016321
child 64155 646c4d6a6a02
     1.1 --- a/src/Pure/Tools/build_log.scala	Sun Oct 09 16:24:54 2016 +0200
     1.2 +++ b/src/Pure/Tools/build_log.scala	Tue Oct 11 20:54:42 2016 +0200
     1.3 @@ -20,6 +20,20 @@
     1.4  {
     1.5    /** directory content **/
     1.6  
     1.7 +  /* file names */
     1.8 +
     1.9 +  def log_date(date: Date): String =
    1.10 +    String.format(Locale.ROOT, "%s.%05d",
    1.11 +      DateTimeFormatter.ofPattern("yyyy-MM-dd").format(date.rep),
    1.12 +      new java.lang.Long((date.time - date.midnight.time).ms / 1000))
    1.13 +
    1.14 +  def log_path(engine: String, date: Date, more: String*): Path =
    1.15 +    Path.explode(date.rep.getYear.toString) +
    1.16 +      Path.explode((engine :: log_date(date) :: more.toList).mkString("", "_", ".log"))
    1.17 +
    1.18 +
    1.19 +  /* log file collections */
    1.20 +
    1.21    def is_log(file: JFile): Boolean =
    1.22      List(".log", ".log.gz", ".log.xz").exists(ext => file.getName.endsWith(ext))
    1.23