support for syslog messages;
authorwenzelm
Wed Dec 28 20:17:01 2016 +0100 (2016-12-28)
changeset 64692ccf017e2f2b4
parent 64691 db2b21a52f20
child 64693 92bcb79a465e
support for syslog messages;
clarified shutdown;
src/Tools/VSCode/src/server.scala
     1.1 --- a/src/Tools/VSCode/src/server.scala	Wed Dec 28 19:58:55 2016 +0100
     1.2 +++ b/src/Tools/VSCode/src/server.scala	Wed Dec 28 20:17:01 2016 +0100
     1.3 @@ -183,6 +183,16 @@
     1.4      }
     1.5  
     1.6  
     1.7 +  /* syslog */
     1.8 +
     1.9 +  private val all_messages =
    1.10 +    Session.Consumer[Prover.Message](getClass.getName) {
    1.11 +      case output: Prover.Output if output.is_syslog =>
    1.12 +        channel.log_writeln(XML.content(output.message))
    1.13 +      case _ =>
    1.14 +    }
    1.15 +
    1.16 +
    1.17    /* init and exit */
    1.18  
    1.19    def init(id: Protocol.Id)
    1.20 @@ -226,6 +236,7 @@
    1.21        session.phase_changed += session_phase
    1.22  
    1.23        session.commands_changed += commands_changed
    1.24 +      session.all_messages += all_messages
    1.25  
    1.26        session.start(receiver =>
    1.27          Isabelle_Process(options = options, logic = session_name, dirs = session_dirs,
    1.28 @@ -248,11 +259,12 @@
    1.29              Session.Consumer(getClass.getName) {
    1.30                case Session.Inactive =>
    1.31                  session.phase_changed -= session_phase
    1.32 +                session.commands_changed -= commands_changed
    1.33 +                session.all_messages -= all_messages
    1.34                  reply("")
    1.35                case _ =>
    1.36              }
    1.37            session.phase_changed += session_phase
    1.38 -          session.commands_changed -= commands_changed
    1.39            session.stop()
    1.40            delay_input.revoke()
    1.41            delay_output.revoke()