Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gehnaphore committed Dec 19, 2018
1 parent 5230d01 commit 9f1a138
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main/core/src/util/Loggers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ case class MultiLogger(colored: Boolean, logger1: Logger, logger2: Logger) exten
}
}


/**
* A Logger that forwards all logging to another Logger. Intended to be
* used as a base class for wrappers that modify logging behavior.
*/
case class ProxyLogger(logger: Logger) extends Logger {
def colored = logger.colored

Expand Down
7 changes: 7 additions & 0 deletions main/src/modules/Jvm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,13 @@ object Jvm {
(deps.toSeq, resolution)
}

/**
* A Coursier Cache.Logger implementation that updates the ticker with the count and
* overall byte size of artifacts being downloaded.
*
* In practice, this ticket output gets prefixed with the current target for which
* dependencies are being resolved, using a ProxyLogger subclass.
*/
class TickerResolutionLogger(ctx: mill.util.Ctx.Log) extends Cache.Logger {
case class DownloadState(var current: Long, var total: Long)
var downloads = new mutable.TreeMap[String,DownloadState]()
Expand Down

0 comments on commit 9f1a138

Please sign in to comment.