Skip to content

Commit

Permalink
Send SymbExLog also when failing.
Browse files Browse the repository at this point in the history
  • Loading branch information
aurecchia committed May 31, 2018
1 parent 674445c commit cca2a72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
10 changes: 4 additions & 6 deletions src/main/scala/viper/server/VerificationWorker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,13 @@ class ViperBackend(private val _frontend: SilFrontend) {
//printSuccess();
_frontend.reporter.report(OverallSuccessMessage(_frontend.getVerifierName, System.currentTimeMillis() - _frontend.startTime))
// TODO: Think again about where to detect and trigger SymbExLogging
if (SymbExLogger.enabled) {
_frontend.reporter.report(SymbExLogReport(System.currentTimeMillis(), Some(SymbExLogger.toJSString())))
}
case f@Failure(_) =>
//printErrors(errors: _*);
_frontend.reporter.report(OverallFailureMessage(_frontend.getVerifierName, System.currentTimeMillis() - _frontend.startTime, f))
if (SymbExLogger.enabled) {
_frontend.reporter.report(SymbExLogReport(System.currentTimeMillis(), None))
}
}

if (SymbExLogger.enabled) {
_frontend.reporter.report(SymbExLogReport(System.currentTimeMillis(), SymbExLogger.toJSString()))
}
}

Expand Down
9 changes: 2 additions & 7 deletions src/main/scala/viper/server/ViperIDEProtocol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,8 @@ object ViperIDEProtocol extends akka.http.scaladsl.marshallers.sprayjson.SprayJs
override def write(obj: SymbExLogReport) = JsObject(
//"entity" -> obj.entity.toJson,
"timestamp" -> obj.timestamp.toJson,
obj.stuff match {
case Some(stuff) =>
//"stuff" -> JsString(s"<json transformer not implemented for attachment ${stuff.toString}>")
"stuff" -> JsString(stuff.toString)
case _ =>
"stuff" -> JsString(s"<empty attachment>")
})
"log" -> JsString(obj.log)
)
})

implicit val stackTraceElement_writer: RootJsonFormat[StackTraceElement] = lift(new RootJsonWriter[java.lang.StackTraceElement] {
Expand Down

0 comments on commit cca2a72

Please sign in to comment.