2

I'm using the sbt-idea plugin and in my metaproject and main project, I have a setting for logLevel := Level.Warn. This is effective at silencing all sub-warning messages from most of my build, but sbt-idea keeps printing out info messages.

I'm guessing that perhaps the plugin gets loaded before logLevel is applied, and it somehow gets a reference to a logger with a different level? The plugin in particular doesn't seem to be doing anything particularly funky about logging, except that it does seem to ask the state for its logger at initialization. It might end up being a different logger object from the one after my settings get applied?

I can't figure out what part of sbt actually consumes the logLevel setting key to see whether it creates a new logger or mutates the existing one.

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
Mysterious Dan
  • 1,316
  • 10
  • 25

1 Answers1

2

Use --warn or --error before gen-idea.

$ sbt --warn gen-idea

or

$ sbt --error gen-idea

See Change the logging level globally for more up-to-date info (pun intended).

Be careful, though, as you may really miss infos after you silence the gen-idea command as it may take a while to complete and nothing gets printed out in the meantime.

It may hence be more useful to use another trick and execute warn or error commands before gen-idea.

$ sbt warn gen-idea
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Set current project to aaa (in build file:/Users/jacek/sandbox/stackoverflow/16256180/)

With this, you'll see something printed out on the console that may or may not be of some help.

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420