Skip to content

Commit

Permalink
Get rid of annoying and misleading "Pruning sources..." sbt message, c…
Browse files Browse the repository at this point in the history
…lose #3245

Motivation:

sbt issues a WARN message every time it has to full compile, eg on
initial run.
This message is very misleading and shouldn’t be WARN but DEBUG.

Modification:

Have ZincCompiler trap this message when it occurs.

Result:

No more misleading WARN log.
  • Loading branch information
slandelle committed Feb 23, 2017
1 parent f23ec54 commit 962a432
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -35,6 +35,8 @@ import io.gatling.compiler.config.ConfigUtils._

object ZincCompiler extends App {

private val MisleadingWarningMessage = "Pruning sources from previous analysis, due to incompatible CompileSetup."

private val configuration = CompilerConfiguration.configuration(args)

private val logger = LoggerFactory.getLogger(getClass)
Expand Down Expand Up @@ -138,7 +140,12 @@ object ZincCompiler extends App {

private val zincLogger = new Logger {
def error(arg: F0[String]): Unit = logger.error(arg.apply)
def warn(arg: F0[String]): Unit = logger.warn(arg.apply)
def warn(arg: F0[String]): Unit = {
val message = arg.apply
if (message != MisleadingWarningMessage) {
logger.warn(arg.apply)
}
}
def info(arg: F0[String]): Unit = logger.info(arg.apply)
def debug(arg: F0[String]): Unit = logger.debug(arg.apply)
def trace(arg: F0[Throwable]): Unit = logger.trace("", arg.apply)
Expand Down

0 comments on commit 962a432

Please sign in to comment.