gpt4 book ai didi

scala - 如何通过 sbt compile 抑制警告

转载 作者:行者123 更新时间:2023-12-01 10:38:24 24 4
gpt4 key购买 nike

我目前正在做项目,我的项目工作正常。但是我想在运行 sbt compile 时抑制警告.当我运行时 sbt compile我不希望我的终端显示警告。

[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

最佳答案

SBT 文档有关于如何更新整个项目或仅一项任务的日志记录级别的完美手册。

你需要做这样的事情:

set logLevel in compile := Level.Error

如果您想在您的 中设置此级别sbt 文件,您可以通过将这一行添加到您的 中来做到这一点。 build.sbt 文件
logLevel := Level.Error 

此外,如果您只想为编译任务指定 logLevel,这将有点棘手,因为您可能还需要为相关任务设置级别。

更多信息请看这里 - http://www.scala-sbt.org/release/docs/Howto-Logging.html

关于scala - 如何通过 sbt compile 抑制警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31934645/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com