]> git.lizzy.rs Git - rust.git/commitdiff
extra::workcache: Remove unused Logger
authorklutzy <klutzytheklutzy@gmail.com>
Tue, 7 Jan 2014 07:30:15 +0000 (16:30 +0900)
committerklutzy <klutzytheklutzy@gmail.com>
Sat, 11 Jan 2014 06:10:28 +0000 (15:10 +0900)
src/libextra/workcache.rs
src/librustpkg/api.rs
src/librustpkg/tests.rs

index db4666c42b60b6a7bb3f6a6429a8a5adce28312b..9dbb607681dcaae93462e7d0144c821d3a66a1f4 100644 (file)
@@ -209,28 +209,11 @@ fn drop(&mut self) {
     }
 }
 
-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 @@ fn is_fresh(&self, cat: &str, kind: &str,
             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 make_path(filename: ~str) -> Path {
     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| {
index 2a1728e2e6b2beb0e8a0d4b5ac22e6c24ce905b8..19586ac48b07807e7cdef25c26634ba039fc8584 100644 (file)
@@ -25,7 +25,7 @@
 use std::run;
 use extra::arc::{Arc,RWArc};
 use extra::workcache;
-use extra::workcache::{Database, Logger, FreshnessMap};
+use extra::workcache::{Database, FreshnessMap};
 use extra::treemap::TreeMap;
 
 // A little sad -- duplicated from rustc::back::*
@@ -70,14 +70,13 @@ pub fn new_workcache_context(p: &Path) -> workcache::Context {
     let db_file = p.join("rustpkg_db.json"); // ??? probably wrong
     debug!("Workcache database file: {}", db_file.display());
     let db = RWArc::new(Database::new(db_file));
-    let lg = RWArc::new(Logger::new());
     let cfg = Arc::new(TreeMap::new());
     let mut freshness: FreshnessMap = TreeMap::new();
     // Set up freshness functions for every type of dependency rustpkg
     // knows about
     freshness.insert(~"file", file_is_fresh);
     freshness.insert(~"binary", binary_is_fresh);
-    workcache::Context::new_with_freshness(db, lg, cfg, Arc::new(freshness))
+    workcache::Context::new_with_freshness(db, cfg, Arc::new(freshness))
 }
 
 pub fn build_lib(sysroot: Path, root: Path, name: ~str, version: Version,
index 7d39be913b4e655e38edcda354d4c10dc64e0c46..86b323609d32aec25f0e73557a2fa788e295ef6d 100644 (file)
@@ -20,7 +20,7 @@
 use extra::arc::RWArc;
 use extra::tempfile::TempDir;
 use extra::workcache;
-use extra::workcache::{Database, Logger};
+use extra::workcache::{Database};
 use extra::treemap::TreeMap;
 use extra::getopts::groups::getopts;
 use std::run::ProcessOutput;
@@ -46,7 +46,6 @@
 fn fake_ctxt(sysroot: Path, workspace: &Path) -> BuildContext {
     let context = workcache::Context::new(
         RWArc::new(Database::new(workspace.join("rustpkg_db.json"))),
-        RWArc::new(Logger::new()),
         Arc::new(TreeMap::new()));
     BuildContext {
         workcache_context: context,