mirror of https://github.com/sbt/sbt.git
Replaced console.err.println by sbt logger
This commit is contained in:
parent
11a3773a11
commit
2acad5bcb2
|
|
@ -79,7 +79,7 @@ object CoursierPlugin extends AutoPlugin {
|
||||||
coursierArtifactsChecksums := Seq(None),
|
coursierArtifactsChecksums := Seq(None),
|
||||||
coursierCachePolicies := CachePolicy.default,
|
coursierCachePolicies := CachePolicy.default,
|
||||||
coursierTtl := Cache.defaultTtl,
|
coursierTtl := Cache.defaultTtl,
|
||||||
coursierVerbosity := Settings.defaultVerbosityLevel,
|
coursierVerbosity := Settings.defaultVerbosityLevel(sLog.value),
|
||||||
mavenProfiles := Set.empty,
|
mavenProfiles := Set.empty,
|
||||||
coursierResolvers <<= Tasks.coursierResolversTask,
|
coursierResolvers <<= Tasks.coursierResolversTask,
|
||||||
coursierRecursiveResolvers <<= Tasks.coursierRecursiveResolversTask,
|
coursierRecursiveResolvers <<= Tasks.coursierRecursiveResolversTask,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package coursier
|
package coursier
|
||||||
|
|
||||||
|
import sbt.Logger
|
||||||
|
|
||||||
import scala.util.{Failure, Success, Try}
|
import scala.util.{Failure, Success, Try}
|
||||||
|
|
||||||
object Settings {
|
object Settings {
|
||||||
|
|
@ -10,7 +12,7 @@ object Settings {
|
||||||
else
|
else
|
||||||
1
|
1
|
||||||
|
|
||||||
def defaultVerbosityLevel: Int = {
|
def defaultVerbosityLevel(logger: Logger): Int = {
|
||||||
|
|
||||||
def fromOption(value: Option[String], description: String): Option[Int] =
|
def fromOption(value: Option[String], description: String): Option[Int] =
|
||||||
value.filter(_.nonEmpty).flatMap {
|
value.filter(_.nonEmpty).flatMap {
|
||||||
|
|
@ -18,8 +20,8 @@ object Settings {
|
||||||
Try(str.toInt) match {
|
Try(str.toInt) match {
|
||||||
case Success(level) => Some(level)
|
case Success(level) => Some(level)
|
||||||
case Failure(ex) =>
|
case Failure(ex) =>
|
||||||
Console.err.println(
|
logger.warn(
|
||||||
s"Warning: unrecognized $description value (should be an integer), ignoring it."
|
s"unrecognized $description value (should be an integer), ignoring it."
|
||||||
)
|
)
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.41" from {
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
val url0 = "https://repo1.maven.org/maven2/com/chuusai/shapeless_2.11/2.3.0/shapeless_2.11-2.3.0.jar"
|
val url0 = "https://repo1.maven.org/maven2/com/chuusai/shapeless_2.11/2.3.0/shapeless_2.11-2.3.0.jar"
|
||||||
|
|
||||||
scala.Console.err.println(s"Fetching $url0")
|
sLog.value.warn(s"Fetching $url0")
|
||||||
|
|
||||||
val url = new java.net.URL(url0)
|
val url = new java.net.URL(url0)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue