Replace `println` by `info` in logger
jvican opened this issue · 5 comments
jvican commented
The codebase has too many println
. We should use the sbt logger and pass it in from function to function.
jiminhsieh commented
I found there are only 2 println
be left in the codebase. Those exist in L25 and L57 of Resolver.scala. I am curious are those need to fix? If it needs to fix, I could give it a shot. Or maybe this issue could be close.
jvican commented
Yeah, they are to fix. Would really appreciate if you give it a shot! 😄
jiminhsieh commented
After I tried some experiments. I have 3 solutions, they all had different log results. I am not sure which one is better.
- Only remove
println
and keepthrow new RuntimeException(s"error uploading to $dest: $fail")
[trace] Stack trace suppressed: run last *:publish for the full output.
[error] (*:publish) error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/jars/sbt-bintray.jar: {"message":"This resource requires authentication"}
- Only replace
println
to sbt logger.
[error] {"message":"This resource requires authentication"}
[trace] Stack trace suppressed: run last *:publish for the full output.
[error] (*:publish) error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/jars/sbt-bintray.jar: {"message":"This resource requires authentication"}
- Replace
println
to sbt logger, removethrow new RuntimeException(s"error uploading to $dest: $fail")
, and merge message of RuntimeException to sbt logger.
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/jars/sbt-bintray.jar: {"message":"This resource requires authentication"}
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/jars/sbt-bintray.jar.sha1: {"message":"This resource requires authentication"}
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/jars/sbt-bintray.jar.md5: {"message":"This resource requires authentication"}
[info] published sbt-bintray to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/jars/sbt-bintray.jar
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/srcs/sbt-bintray-sources.jar: {"message":"This resource requires authentication"}
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/srcs/sbt-bintray-sources.jar.sha1: {"message":"This resource requires authentication"}
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/srcs/sbt-bintray-sources.jar.md5: {"message":"This resource requires authentication"}
[info] published sbt-bintray to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/srcs/sbt-bintray-sources.jar
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/docs/sbt-bintray-javadoc.jar: {"message":"This resource requires authentication"}
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/docs/sbt-bintray-javadoc.jar.sha1: {"message":"This resource requires authentication"}
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/docs/sbt-bintray-javadoc.jar.md5: {"message":"This resource requires authentication"}
[info] published sbt-bintray to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/docs/sbt-bintray-javadoc.jar
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/ivys/ivy.xml: {"message":"This resource requires authentication"}
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/ivys/ivy.xml.sha1: {"message":"This resource requires authentication"}
[error] error uploading to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/ivys/ivy.xml.md5: {"message":"This resource requires authentication"}
[info] published ivy to org.foundweekends/sbt-bintray/scala_2.10/sbt_0.13/0.5.2-SNAPSHOT/ivys/ivy.xml
[trace] Stack trace suppressed: run last *:bintrayRelease for the full output.
[error] (*:bintrayRelease) failed to release sbt/sbt-bintray@0.5.2-SNAPSHOT: {"message":"This resource requires authentication"}
In my opinion, I think 1. would much easier for user to read.
jvican commented
Yeah, I agree 1. is the way to go.