【问题标题】:Why does sbt 1.02 not suppress debug logging messages?为什么 sbt 1.02 不抑制调试日志消息?
【发布时间】:2018-03-27 13:18:17
【问题描述】:

安装细节:

  • SBT 1.02
  • Scala 2.12.3
  • Java 8
  • ThinkPad 和 Mac OS X Sierra (10.12.6) 上的 Ubuntu Linux 16.04

我采取的步骤:

  1. 使用此处的说明在 Linux 和 Mac 上安装 SBT:http://www.scala-sbt.org/1.x/docs/
  2. 创建了 Hello World 示例。
  3. 尝试在 SBT 和 bash 命令行中运行示例程序。
  4. 观察到无论我尝试什么设置,我仍然会看到调试消息:

这是一个示例:

Osiris:hello Noel$ sbt
[info] Loading project definition from 
/Users/Noel/src/scala/sandbox/hello/project
[info] Loading settings from build.sbt ...
[info] Set current project to Hello (in build 
file:/Users/Noel/src/scala/sandbox/hello/)
[info] sbt server started at 127.0.0.1:5256
sbt:Hello> logLevel
[info] warn
sbt:Hello> run
[info] Running example.Hello 
hello
[debug] Waiting for threads to exit or System.exit to be called.
[debug]   Classpath:
[debug]     <abbreviated>.../hello_2.12-0.1.0-SNAPSHOT.jar
[debug]     <abbreviated>.../scala-library.jar
[debug] Waiting for thread run-main-0 to terminate.
[debug]     Thread run-main-0 exited.
[debug] Interrupting remaining threads (should be all daemons).
[debug] Sandboxed run complete..
[debug] Exited with code 0
[success] Total time: 0 s, completed Oct 15, 2017 9:44:13 PM
sbt:Hello> 

我尝试了什么:

  1. 从命令行: sbt 警告运行
  2. 从 SBT 内部: 警告 运行
  3. 修改 build.sbt 以包含以下行: logLevel := Level.Warn

这是 build.sbt 的样子:

import Dependencies._

logLevel := Level.Warn

lazy val root = (project in file(".")).
  settings(
    inThisBuild(List(
      organization := "com.example",
      scalaVersion := "2.12.3",
      version      := "0.1.0-SNAPSHOT",
    )),
    name := "Hello",
    libraryDependencies += scalaTest % Test
  )

我也在这个论坛上搜索过,但这个问题是 4 年前提出的,这些答案对我不起作用。我错过了什么?

提前致谢。

【问题讨论】:

    标签: sbt


    【解决方案1】:

    这是 sbt 1.0.1 和 1.0.2 中的一个已知错误。见https://github.com/sbt/sbt/issues/3655

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-31
      • 1970-01-01
      • 2018-01-26
      • 1970-01-01
      • 2018-09-05
      • 2014-06-25
      • 1970-01-01
      相关资源
      最近更新 更多