How to print in a stream during sbt installation initialization

I am trying to print a warning message by setting the sbt parameter. My initial attempt looks something like this:

setting := { val log = streams.value.log val condition = //check something if (condition) { log.warn("Warning, condition! Specific functionality may not work.") //some default } else { //something else } } 

However, since streams is a TaskKey, its value can only be accessed from tasks. In addition, my setting is reused by other settings, so I have no way to define it as a task.

Hence my question: what is the best way to print warnings during initialization setup?

+6
source share
1 answer
 sLog.value.warn("danger!") 

sLog is SettingKey[Logger] for use from initialization setup.

+7
source

All Articles