diff --git a/plugin/src/main/scala/org/scalafmt/sbt/ScalafmtPlugin.scala b/plugin/src/main/scala/org/scalafmt/sbt/ScalafmtPlugin.scala index cd91beb..ec9ed45 100644 --- a/plugin/src/main/scala/org/scalafmt/sbt/ScalafmtPlugin.scala +++ b/plugin/src/main/scala/org/scalafmt/sbt/ScalafmtPlugin.scala @@ -9,6 +9,7 @@ import sbt.librarymanagement.MavenRepository import sbt.util.CacheImplicits._ import sbt.util.CacheStoreFactory import sbt.util.FileInfo +import sbt.util.Level import scala.util.Failure import scala.util.Success @@ -113,6 +114,13 @@ object ScalafmtPlugin extends AutoPlugin { val diffRefPrefix = "diff-ref=" } + private class ScalafmtLogger(log: Logger) extends Logger { + override def trace(t: => Throwable): Unit = log.trace(t) + override def success(message: => String): Unit = success(message) + override def log(level: Level.Value, message: => String): Unit = + log.log(level, "scalafmt: " + message) + } + private class FormatSession( config: Path, taskStreams: TaskStreams, diff --git a/plugin/src/main/scala/org/scalafmt/sbt/ScalafmtSbtReporter.scala b/plugin/src/main/scala/org/scalafmt/sbt/ScalafmtSbtReporter.scala index e33ec39..effee5d 100644 --- a/plugin/src/main/scala/org/scalafmt/sbt/ScalafmtSbtReporter.scala +++ b/plugin/src/main/scala/org/scalafmt/sbt/ScalafmtSbtReporter.scala @@ -25,6 +25,7 @@ class ScalafmtSbtReporter( override def error(file: Path, message: String, e: Throwable): Unit = { def getMessage() = { val res = new StringWriter() + res.write("scalafmt: ") res.write(Option(message).getOrElse("failed")) res.write(" [") res.write(file.toString)