2017-10-16 103 views
3

安裝細節:爲什麼sbt 1.02不禁止調試日誌消息?

  • SBT 1.02
  • 斯卡拉2.12.3
  • 的Java 8
  • Ubuntu Linux操作系統的16.04上的ThinkPad &的Mac OS X塞拉利昂(10.12.6)

我採取的步驟:

  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. 從命令line: sbt warn run
  2. SBT內: warn 運行
  3. 修改build.sbt包含線路: 日誌等級:= 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年前被問及,這些答案不適合我。我錯過了什麼?

在此先感謝。

回答