Skip to content

Commit

Permalink
Logger (#304)
Browse files Browse the repository at this point in the history
* update scalafmt

* Fix logger
`
  • Loading branch information
mlachkar committed Jan 6, 2022
1 parent e43c78c commit d33a361
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
5 changes: 5 additions & 0 deletions migrate/src/main/scala/migrate/Scala3Migrate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ import scalafix.interfaces.ScalafixEvaluation

class Scala3Migrate(scalafixSrv: ScalafixService) {
private val reporter = ScalaMigrateLogger
// modify the default formatter
scribe.Logger.root
.clearHandlers()
.withHandler(formatter = scribe.format.Formatter.compact)
.replace()

def previewMigration(
unmanagedSources: Seq[AbsolutePath],
Expand Down
15 changes: 15 additions & 0 deletions migrate/src/main/scala/migrate/internal/ScalaMigrateLogger.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package migrate.internal

import compiler.interfaces.Logger

case object ScalaMigrateLogger extends Logger {

private val logger = scribe
.Logger()
.orphan()
.replace()
.clearHandlers()
.withHandler(formatter = scribe.format.Formatter.simple)
.replace()
override def error(log: String): Unit = logger.error(log)
}

This file was deleted.

2 changes: 1 addition & 1 deletion migrate/src/main/scala/migrate/utils/CoursierHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object CoursierHelper {
case (_, Right(revisions)) => revisions
case _ => Nil
}
revisions.map(Revision(_))
revisions.map(Revision.apply)
}

// Rely on coursier order
Expand Down

0 comments on commit d33a361

Please sign in to comment.