diff options
| author | klutzy <klutzytheklutzy@gmail.com> | 2014-01-07 16:30:15 +0900 |
|---|---|---|
| committer | klutzy <klutzytheklutzy@gmail.com> | 2014-01-11 15:10:28 +0900 |
| commit | d578ecc4072a0e0fade7d564f0ae6dac31c3fb45 (patch) | |
| tree | 859138695a1e04a9b8b2ac94fcfbb0061fbf3875 /src/libextra | |
| parent | a34727f27657cbed71fb2326dc6f1766fee95a4c (diff) | |
| download | rust-d578ecc4072a0e0fade7d564f0ae6dac31c3fb45.tar.gz rust-d578ecc4072a0e0fade7d564f0ae6dac31c3fb45.zip | |
extra::workcache: Remove unused Logger
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/workcache.rs | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs index db4666c42b6..9dbb607681d 100644 --- a/src/libextra/workcache.rs +++ b/src/libextra/workcache.rs @@ -209,28 +209,11 @@ impl Drop for Database { } } -pub struct Logger { - // FIXME #4432: Fill in - priv a: () -} - -impl Logger { - - pub fn new() -> Logger { - Logger { a: () } - } - - pub fn info(&self, i: &str) { - info!("workcache: {}", i); - } -} - pub type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>; #[deriving(Clone)] pub struct Context { db: RWArc<Database>, - priv logger: RWArc<Logger>, priv cfg: Arc<json::Object>, /// Map from kinds (source, exe, url, etc.) to a freshness function. /// 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 { impl Context { pub fn new(db: RWArc<Database>, - lg: RWArc<Logger>, cfg: Arc<json::Object>) -> Context { - Context::new_with_freshness(db, lg, cfg, Arc::new(TreeMap::new())) + Context::new_with_freshness(db, cfg, Arc::new(TreeMap::new())) } pub fn new_with_freshness(db: RWArc<Database>, - lg: RWArc<Logger>, cfg: Arc<json::Object>, freshness: Arc<FreshnessMap>) -> Context { Context { db: db, - logger: lg, cfg: cfg, freshness: freshness } @@ -378,15 +358,11 @@ impl<'a> Prep<'a> { None => fail!("missing freshness-function for '{}'", kind), Some(f) => (*f)(name, val) }; - self.ctxt.logger.write(|lg| { - if fresh { - lg.info(format!("{} {}:{} is fresh", - cat, kind, name)); - } else { - lg.info(format!("{} {}:{} is not fresh", - cat, kind, name)) - } - }); + if fresh { + info!("{} {}:{} is fresh", cat, kind, name); + } else { + info!("{} {}:{} is not fresh", cat, kind, name); + } fresh } @@ -509,7 +485,6 @@ fn test() { let db_path = make_path(~"db.json"); let cx = Context::new(RWArc::new(Database::new(db_path)), - RWArc::new(Logger::new()), Arc::new(TreeMap::new())); let s = cx.with_prep("test1", |prep| { |
