diff --git a/Cargo.lock b/Cargo.lock index 8054dd95..9edad06a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ [root] name = "libracerd" -version = "0.3.2" +version = "0.3.3" dependencies = [ "bodyparser 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.6.86 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9,7 +9,7 @@ dependencies = [ "iron 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "iron-hmac 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "logger 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "persistent 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "racer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -242,11 +242,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "logger" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "iron 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -715,7 +716,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f" "checksum libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "23e3757828fa702a20072c37ff47938e9dd331b92fac6e223d26d4b7a55f7ee2" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" -"checksum logger 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3cf2488134e30432708391618d45fbdbf925223b842bba4f962fd03632b9566b" +"checksum logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92ff59f9a797ff30f711fe6b8489ad424953cee17c206de77d3c5957a9182ba7" "checksum matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "15305656809ce5a4805b1ff2946892810992197ce1270ff79baded852187942e" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5c93a4bd787ddc6e7833c519b73a50883deb5863d76d9b71eb8216fb7f94e66" diff --git a/Cargo.toml b/Cargo.toml index a8f4687e..bc52ceaa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ hyper = { version = "0.9", default-features = false } iron = { version = "0.4", default-features = false } iron-hmac = { version = "0.4", features = ["hmac-rust-crypto"] } log = "0.3" -logger = "0.1.0" +logger = "0.3.0" persistent = "0.2" racer = "2.0.2" rand = "0.3" diff --git a/src/http/mod.rs b/src/http/mod.rs index 6fc6a706..9e5123bd 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -62,7 +62,7 @@ impl Key for EngineProvider { pub fn serve(config: &Config, engine: E) -> Result { use persistent::{Read, Write}; use logger::Logger; - use logger::format::Format; + use logger::Format; let mut chain = Chain::new(router!( post "/parse_file" => file::parse, @@ -71,8 +71,7 @@ pub fn serve(config: &Config, engine: E) -> Result< get "/ping" => ping::pong)); // Logging middleware - let log_fmt = Format::new("{method} {uri} -> {status} ({response-time})", - Vec::new(), Vec::new()); + let log_fmt = Format::new("{method} {uri} -> {status} ({response-time})"); let (log_before, log_after) = Logger::new(log_fmt); // log_before must be first middleware in before chain @@ -113,9 +112,7 @@ pub fn serve(config: &Config, engine: E) -> Result< let app = Iron::new(chain); - Ok(Server { - inner: try!(app.http((&config.addr[..], config.port))) - }) + Ok(Server { inner: try!(app.http((&config.addr[..], config.port))) }) } /// Wrapper type with information and control of the underlying HTTP server