How do you set logLevel
when using streams.value.log
in an SBT task?
For instance, how can this task's logs be supressed to just Warn
logs?:
lazy val mainRunner = taskKey[Seq[File]]("Runs a main method")
lazy val mainRunnerSetting = mainRunner := {
val logger = streams.value.log
(runner in Compile).value.run(
mainClass = "com.me.Main",
classpath = (dependencyClasspath in Compile).value.files,
log = logger,
options = Array()
)
}
Inside and outside the task I've tried various logLevel settings, like:
logLevel in run in Compile := Level.Warn
logLevel := Level.Warn
logLevel in mainRunner := Level.Warn
logLevel in streams := Level.Warn
...but it always is set to Info
when this task executes