diff options
Diffstat (limited to 'contrib/bsp/src/mill/contrib/bsp/MillBspLogger.scala')
-rw-r--r-- | contrib/bsp/src/mill/contrib/bsp/MillBspLogger.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/bsp/src/mill/contrib/bsp/MillBspLogger.scala b/contrib/bsp/src/mill/contrib/bsp/MillBspLogger.scala index 195d9aab..a17c4a40 100644 --- a/contrib/bsp/src/mill/contrib/bsp/MillBspLogger.scala +++ b/contrib/bsp/src/mill/contrib/bsp/MillBspLogger.scala @@ -4,6 +4,19 @@ import ch.epfl.scala.bsp4j._ import mill.api.Logger import mill.util.ProxyLogger + +/** + * BSP-specialized logger class which sends `task-progress` + * notifications ( upon the invocation of the `ticker` method ) and + * `show-message` notifications ( for each error or information + * being logged ). + * @param client the client to send notifications to, also the + * client that initiated a request which triggered + * a mill task evaluation + * @param taskId unique ID of the task being evaluated + * @param logger the logger to which the messages received by this + * MillBspLogger are being redirected + */ class MillBspLogger(client: BuildClient, taskId: Int, logger: Logger) extends ProxyLogger(logger) { override def ticker(s: String): Unit = { @@ -17,6 +30,7 @@ class MillBspLogger(client: BuildClient, taskId: Int, logger: Logger) extends Pr params.setProgress(progress(0).toLong) params.setTotal(progress(1).toLong) client.onBuildTaskProgress(params) + super.ticker(s) } catch { case e: Exception => } |