Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress Warning by sbt compile

I am currently working on project, my project works fine and working. But i want to suppress the warning when i run sbt compile. when i run sbt compile i don't want my terminal to show warning.

[warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:14: imported `QueryString' is permanently hidden by   definition of class QueryString in package misc
[warn] import misc.QueryString
[warn]             ^
[warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:26: method apply in trait WithResult is deprecated: Use   [[fold]], [[foldWhile]] or [[withResult]] instead, which manages resources and memory
[warn]       val resultSet = query().map(
[warn]                       ^
[warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:58: method apply in trait WithResult is deprecated: Use [[fold]], [[foldWhile]] or [[withResult]] instead, which manages resources and memory
[warn]       val resultSet = query().map(
[warn]                       ^
[warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:89: method apply in trait WithResult is deprecated: Use [[fold]], [[foldWhile]] or [[withResult]] instead, which manages resources and memory
[warn]       val resultSet = query().map(
[warn]                       ^
[warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:121: method apply in trait WithResult is deprecated: Use [[fold]], [[foldWhile]] or [[withResult]] instead, which manages resources and memory
[warn]         val resultSet = query().map(
[warn]                         ^
[warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:329: method apply in trait WithResult is deprecated: Use [[fold]], [[foldWhile]] or [[withResult]] instead, which manages resources and memory
[warn]       val resultSet = query().map(
[warn]                       ^
[warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:351: method apply in trait WithResult is deprecated: Use [[fold]], [[foldWhile]] or [[withResult]] instead, which manages resources and memory
[warn]       val resultSet = query().map(
[warn]                       ^
[warn] 7 warnings found
like image 958
Hackaholic Avatar asked Jan 08 '23 19:01

Hackaholic


1 Answers

SBT documentation have a perfect manual on how to update logging level for whole project or just for one task.

You need to do something like this:

set logLevel in compile := Level.Error

If you want to set this level in your sbt file, you could do that, by adding this line into your build.sbt file

logLevel := Level.Error 

Also if you want to specify logLevel only for compile task it will be a little bit tricky, since you're probably need to set level for dependent tasks as well.

For more information take a look here - http://www.scala-sbt.org/release/docs/Howto-Logging.html

like image 150
Mysterion Avatar answered Jan 19 '23 03:01

Mysterion