From 0729798cce3363abe2281c80673bfcf0796c0446 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sun, 27 Feb 2011 00:36:54 -0500 Subject: [PATCH] keys cleanup --- main/Keys.scala | 4 ++++ main/LogManager.scala | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/main/Keys.scala b/main/Keys.scala index f18411c15..99115933f 100644 --- a/main/Keys.scala +++ b/main/Keys.scala @@ -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") diff --git a/main/LogManager.scala b/main/LogManager.scala index 118830d9e..10408094b 100644 --- a/main/LogManager.scala +++ b/main/LogManager.scala @@ -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") } \ No newline at end of file