keys cleanup

This commit is contained in:
Mark Harrah 2011-02-27 00:36:54 -05:00
parent c21c580314
commit 0729798cce
2 changed files with 7 additions and 5 deletions

View File

@ -15,6 +15,10 @@ package sbt
object Keys
{
// logging
val LogLevel = SettingKey[Level.Value]("log-level")
val PersistLogLevel = SettingKey[Level.Value]("persist-log-level")
// Project keys
val ProjectCommand = AttributeKey[Boolean]("project-command")
val SessionKey = AttributeKey[SessionSettings]("session-settings")

View File

@ -7,6 +7,7 @@ package sbt
import LogManager._
import std.Transform
import Project.ScopedKey
import Keys.{LogLevel => ScreenLogLevel, PersistLogLevel}
object LogManager
{
@ -14,8 +15,8 @@ object LogManager
{
val scope = task.scope
def level(key: AttributeKey[Level.Value], default: Level.Value): Level.Value = data.get(scope, key) getOrElse default
val screenLevel = level(ScreenLogLevel, Level.Info)
val backingLevel = level(PersistLogLevel, Level.Debug)
val screenLevel = level(ScreenLogLevel.key, Level.Info)
val backingLevel = level(PersistLogLevel.key, Level.Debug)
val console = ConsoleLogger()
val backed = ConsoleLogger(ConsoleLogger.printWriterOut(to), useColor = false) // TODO: wrap this with a filter that strips ANSI codes
@ -28,7 +29,4 @@ object LogManager
backed setLevel backingLevel
multi: Logger
}
val ScreenLogLevel = AttributeKey[Level.Value]("screen-log-level")
val PersistLogLevel = AttributeKey[Level.Value]("persist-log-level")
}