clarified modules;
authorwenzelm
Mon Dec 19 20:46:15 2016 +0100 (2016-12-19)
changeset 64606a871fa7c24fc
parent 64605 9c1173a7e4cb
child 64608 20ccca53dd73
child 64609 7cc4b49be1ea
clarified modules;
src/Pure/General/logger.scala
src/Pure/build-jars
src/Tools/VSCode/src/logger.scala
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/Pure/General/logger.scala	Mon Dec 19 20:46:15 2016 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +/*  Title:      Pure/General/logger.scala
     1.5 +    Author:     Makarius
     1.6 +
     1.7 +Minimal logging support.
     1.8 +*/
     1.9 +
    1.10 +package isabelle
    1.11 +
    1.12 +
    1.13 +object Logger
    1.14 +{
    1.15 +  def make(log_file: Option[Path]): Logger =
    1.16 +    log_file match { case Some(file) => new File_Logger(file) case None => No_Logger }
    1.17 +}
    1.18 +
    1.19 +trait Logger
    1.20 +{
    1.21 +  def apply(msg: => String): Unit
    1.22 +}
    1.23 +
    1.24 +object No_Logger extends Logger
    1.25 +{
    1.26 +  def apply(msg: => String) { }
    1.27 +}
    1.28 +
    1.29 +class File_Logger(path: Path) extends Logger
    1.30 +{
    1.31 +  def apply(msg: => String) { synchronized { File.append(path, msg + "\n") } }
    1.32 +
    1.33 +  override def toString: String = path.toString
    1.34 +}
     2.1 --- a/src/Pure/build-jars	Mon Dec 19 20:27:49 2016 +0100
     2.2 +++ b/src/Pure/build-jars	Mon Dec 19 20:46:15 2016 +0100
     2.3 @@ -49,6 +49,7 @@
     2.4    General/http_server.scala
     2.5    General/json.scala
     2.6    General/linear_set.scala
     2.7 +  General/logger.scala
     2.8    General/long_name.scala
     2.9    General/mercurial.scala
    2.10    General/multi_map.scala
    2.11 @@ -156,7 +157,6 @@
    2.12    "../Tools/VSCode/src/channel.scala"
    2.13    "../Tools/VSCode/src/document_model.scala"
    2.14    "../Tools/VSCode/src/line.scala"
    2.15 -  "../Tools/VSCode/src/logger.scala"
    2.16    "../Tools/VSCode/src/protocol.scala"
    2.17    "../Tools/VSCode/src/server.scala"
    2.18    "../Tools/VSCode/src/uri_resources.scala"
     3.1 --- a/src/Tools/VSCode/src/logger.scala	Mon Dec 19 20:27:49 2016 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,34 +0,0 @@
     3.4 -/*  Title:      Tools/VSCode/src/logger.scala
     3.5 -    Author:     Makarius
     3.6 -
     3.7 -Minimal logging support.
     3.8 -*/
     3.9 -
    3.10 -package isabelle.vscode
    3.11 -
    3.12 -
    3.13 -import isabelle._
    3.14 -
    3.15 -
    3.16 -object Logger
    3.17 -{
    3.18 -  def make(log_file: Option[Path]): Logger =
    3.19 -    log_file match { case Some(file) => new File_Logger(file) case None => No_Logger }
    3.20 -}
    3.21 -
    3.22 -trait Logger
    3.23 -{
    3.24 -  def apply(msg: => String): Unit
    3.25 -}
    3.26 -
    3.27 -object No_Logger extends Logger
    3.28 -{
    3.29 -  def apply(msg: => String) { }
    3.30 -}
    3.31 -
    3.32 -class File_Logger(path: Path) extends Logger
    3.33 -{
    3.34 -  def apply(msg: => String) { synchronized { File.append(path, msg + "\n") } }
    3.35 -
    3.36 -  override def toString: String = path.toString
    3.37 -}