@@ -209,28 +209,11 @@ impl Drop for Database {
209
209
}
210
210
}
211
211
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
-
228
212
pub type FreshnessMap = TreeMap < ~str , extern fn ( & str , & str ) ->bool > ;
229
213
230
214
#[ deriving( Clone ) ]
231
215
pub struct Context {
232
216
db : RWArc < Database > ,
233
- priv logger : RWArc < Logger > ,
234
217
priv cfg: Arc < json:: Object > ,
235
218
/// Map from kinds (source, exe, url, etc.) to a freshness function.
236
219
/// 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 {
275
258
impl Context {
276
259
277
260
pub fn new ( db : RWArc < Database > ,
278
- lg : RWArc < Logger > ,
279
261
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 ( ) ) )
281
263
}
282
264
283
265
pub fn new_with_freshness ( db : RWArc < Database > ,
284
- lg : RWArc < Logger > ,
285
266
cfg : Arc < json:: Object > ,
286
267
freshness : Arc < FreshnessMap > ) -> Context {
287
268
Context {
288
269
db : db,
289
- logger : lg,
290
270
cfg : cfg,
291
271
freshness : freshness
292
272
}
@@ -378,15 +358,11 @@ impl<'a> Prep<'a> {
378
358
None => fail ! ( "missing freshness-function for '{}'" , kind) ,
379
359
Some ( f) => ( * f) ( name, val)
380
360
} ;
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
+ }
390
366
fresh
391
367
}
392
368
@@ -509,7 +485,6 @@ fn test() {
509
485
let db_path = make_path( ~"db. json") ;
510
486
511
487
let cx = Context :: new( RWArc :: new( Database :: new( db_path) ) ,
512
- RWArc :: new( Logger :: new( ) ) ,
513
488
Arc :: new( TreeMap :: new( ) ) ) ;
514
489
515
490
let s = cx. with_prep( "test1" , |prep| {
0 commit comments