summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Stock <stuart@int08h.com>2018-02-24 22:36:08 -0600
committerStuart Stock <stuart@int08h.com>2018-02-24 22:40:14 -0600
commitca97effa01f977ae775e8f8249421b9fc6d64e72 (patch)
treed315ab8663b4f89feac240fa2ef48917c8aea19f
parentae47aa86ed2157325c70a8a9582aecd3857bc15d (diff)
downloadroughenough-ca97effa01f977ae775e8f8249421b9fc6d64e72.zip
Use simple_logger instead of fern
Fern's configurability and features are overkill. As a bonus, compile time and binary size both shrink a bit.
-rw-r--r--Cargo.toml7
-rw-r--r--src/bin/server.rs17
2 files changed, 6 insertions, 18 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 57bd058..6e7aa34 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,14 +12,15 @@ keywords = ["roughtime", "cryptography", "crypto"]
travis-ci = { repository = "int08h/roughenough", branch = "master" }
[dependencies]
+mio = "0.6"
byteorder = "1"
ring = "0.12"
untrusted = "0.5.1"
time = "0.1"
-log = "0.3"
-fern = "0.4"
+log = "0.4.1"
+simple_logger = "0.5"
yaml-rust = "0.3.5"
-ctrlc = { version = "3.0", features = ["termination"] }
+ctrlc = { version = "3.1", features = ["termination"] }
[dev-dependencies]
criterion = "0.2.0"
diff --git a/src/bin/server.rs b/src/bin/server.rs
index 3244306..6bd2ad1 100644
--- a/src/bin/server.rs
+++ b/src/bin/server.rs
@@ -46,11 +46,11 @@ extern crate ring;
extern crate roughenough;
extern crate time;
extern crate untrusted;
-extern crate fern;
extern crate ctrlc;
extern crate yaml_rust;
#[macro_use]
extern crate log;
+extern crate simple_logger;
extern crate mio;
use std::env;
@@ -213,19 +213,6 @@ fn nonce_from_request(buf: &[u8], num_bytes: usize) -> Result<&[u8], Error> {
}
}
-fn init_logging() {
- fern::Dispatch::new()
- .format(|out, message, record| {
- out.finish(
- format_args!("{} [{}] {}", time::now().rfc3339(), record.level(), message)
- )
- })
- .level(log::LogLevelFilter::Info)
- .chain(std::io::stdout())
- .apply()
- .unwrap();
-}
-
fn load_config(config_file: &str) -> (SocketAddr, Vec<u8>) {
let mut infile = File::open(config_file)
.expect("failed to open config file");
@@ -326,7 +313,7 @@ fn polling_loop(addr: &SocketAddr, mut ephemeral_key: &mut Signer, cert_bytes: &
}
fn main() {
- init_logging();
+ simple_logger::init().unwrap();
info!("Roughenough server v{} starting", SERVER_VERSION);