@@ -209,28 +209,11 @@ impl Drop for Database {
209209 }
210210}
211211
212- pub struct Logger {
213- // FIXME #4432: Fill in
214- priv a: ( )
215- }
216-
217- impl Logger {
218-
219- pub fn new ( ) -> Logger {
220- Logger { a : ( ) }
221- }
222-
223- pub fn info ( & self , i : & str ) {
224- info ! ( "workcache: {}" , i) ;
225- }
226- }
227-
228212pub type FreshnessMap = TreeMap < ~str , extern fn ( & str , & str ) ->bool > ;
229213
230214#[ deriving( Clone ) ]
231215pub struct Context {
232216 db : RWArc < Database > ,
233- priv logger : RWArc < Logger > ,
234217 priv cfg: Arc < json:: Object > ,
235218 /// Map from kinds (source, exe, url, etc.) to a freshness function.
236219 /// The freshness function takes a name (e.g. file path) and value
@@ -275,18 +258,15 @@ fn json_decode<T:Decodable<json::Decoder>>(s: &str) -> T {
275258impl Context {
276259
277260 pub fn new ( db : RWArc < Database > ,
278- lg : RWArc < Logger > ,
279261 cfg : Arc < json:: Object > ) -> Context {
280- Context :: new_with_freshness ( db, lg , cfg, Arc :: new ( TreeMap :: new ( ) ) )
262+ Context :: new_with_freshness ( db, cfg, Arc :: new ( TreeMap :: new ( ) ) )
281263 }
282264
283265 pub fn new_with_freshness ( db : RWArc < Database > ,
284- lg : RWArc < Logger > ,
285266 cfg : Arc < json:: Object > ,
286267 freshness : Arc < FreshnessMap > ) -> Context {
287268 Context {
288269 db : db,
289- logger : lg,
290270 cfg : cfg,
291271 freshness : freshness
292272 }
@@ -378,15 +358,11 @@ impl<'a> Prep<'a> {
378358 None => fail ! ( "missing freshness-function for '{}'" , kind) ,
379359 Some ( f) => ( * f) ( name, val)
380360 } ;
381- self . ctxt . logger . write ( |lg| {
382- if fresh {
383- lg. info ( format ! ( "{} {}:{} is fresh" ,
384- cat, kind, name) ) ;
385- } else {
386- lg. info ( format ! ( "{} {}:{} is not fresh" ,
387- cat, kind, name) )
388- }
389- } ) ;
361+ if fresh {
362+ info ! ( "{} {}:{} is fresh" , cat, kind, name) ;
363+ } else {
364+ info ! ( "{} {}:{} is not fresh" , cat, kind, name) ;
365+ }
390366 fresh
391367 }
392368
@@ -509,7 +485,6 @@ fn test() {
509485 let db_path = make_path( ~"db. json") ;
510486
511487 let cx = Context :: new( RWArc :: new( Database :: new( db_path) ) ,
512- RWArc :: new( Logger :: new( ) ) ,
513488 Arc :: new( TreeMap :: new( ) ) ) ;
514489
515490 let s = cx. with_prep( "test1" , |prep| {
0 commit comments