Remove use of deprecated `logger(s)` call

This commit is contained in:
Indrajit Raychaudhuri 2012-02-28 19:07:47 +05:30
parent 940b77f940
commit 0a6f58a761
1 changed files with 14 additions and 16 deletions

View File

@ -73,7 +73,7 @@ object BuiltinCommands
def boot = Command.make(BootCommand)(bootParser)
def about = Command.command(AboutCommand, aboutBrief, aboutDetailed) { s => logger(s).info(aboutString(s)); s }
def about = Command.command(AboutCommand, aboutBrief, aboutDetailed) { s => s.log.info(aboutString(s)); s }
// This parser schedules the default boot commands unless overridden by an alias
def bootParser(s: State) =
@ -149,17 +149,16 @@ object BuiltinCommands
}
def eval = Command.single(EvalCommand, evalBrief, evalDetailed) { (s, arg) =>
val log = logger(s)
val extracted = Project extract s
import extracted._
val result = session.currentEval().eval(arg, srcName = "<eval>", imports = autoImports(extracted))
log.info("ans: " + result.tpe + " = " + result.getValue(currentLoader))
s.log.info("ans: " + result.tpe + " = " + result.getValue(currentLoader))
s
}
def sessionCommand = Command.make(SessionCommand, sessionBrief, SessionSettings.Help)(SessionSettings.command)
def reapply(newSession: SessionSettings, structure: Load.BuildStructure, s: State): State =
{
logger(s).info("Reapplying settings...")
s.log.info("Reapplying settings...")
val newStructure = Load.reapply(newSession.mergeSettings, structure)( Project.showContextKey(newSession, structure) )
Project.setProject(newSession, newStructure, s)
}
@ -177,7 +176,7 @@ object BuiltinCommands
session.appendSettings( append map (a => (a, arg)))
}
def inspect = Command(InspectCommand, inspectBrief, inspectDetailed)(inspectParser) { case (s, (option, sk)) =>
logger(s).info(inspectOutput(s, option, sk))
s.log.info(inspectOutput(s, option, sk))
s
}
def inspectOutput(s: State, option: InspectOption, sk: Project.ScopedKey[_]): String =
@ -295,9 +294,8 @@ object BuiltinCommands
val extracted = Project extract s
import extracted._
import currentRef.{build => curi, project => cid}
val log = logger(s)
listBuild(curi, structure.units(curi), true, cid, log)
for( (uri, build) <- structure.units if curi != uri) listBuild(uri, build, false, cid, log)
listBuild(curi, structure.units(curi), true, cid, s.log)
for( (uri, build) <- structure.units if curi != uri) listBuild(uri, build, false, cid, s.log)
s
}
@ -316,7 +314,7 @@ object BuiltinCommands
else if(matches("ignore"))
{
val hadPrevious = Project.isProjectLoaded(s)
logger(s).warn("Ignoring load failure: " + (if(hadPrevious) "using previously loaded project." else "no project loaded."))
s.log.warn("Ignoring load failure: " + (if(hadPrevious) "using previously loaded project." else "no project loaded."))
s
}
else if(matches("last"))
@ -334,7 +332,7 @@ object BuiltinCommands
def loadProjectImpl = Command(LoadProjectImpl)(_ => Project.loadActionParser) { (s0, action) =>
val (s, base) = Project.loadAction(SessionVar.clear(s0), action)
IO.createDirectory(base)
val (eval, structure) = Load.defaultLoad(s, base, logger(s))
val (eval, structure) = Load.defaultLoad(s, base, s.log)
val session = Load.initialSession(structure, eval, s0)
SessionSettings.checkSession(session, s)
Project.setProject(session, structure, s)