@@ -15,7 +15,7 @@ fn main() { | |||||
let plain = slog_term::PlainSyncDecorator::new(std::io::stdout()); | let plain = slog_term::PlainSyncDecorator::new(std::io::stdout()); | ||||
let plain_fuse = slog_term::FullFormat::new(plain).build().fuse(); | let plain_fuse = slog_term::FullFormat::new(plain).build().fuse(); | ||||
let w = logging::warnings::WarningsManager::new("test"); | let w = logging::warnings::WarningsManager::new("test"); | ||||
let w_drain = logging::warnings::WarningsDrain::new(w.tx.clone(), plain_fuse); | |||||
let w_drain = logging::warnings::WarningsDrain::new(w.tx.clone(), Level::Debug, plain_fuse); | |||||
//let zmq_drain = ZmqDrain::new(plain_fuse); | //let zmq_drain = ZmqDrain::new(plain_fuse); | ||||
//let zmq_decorator = slog_term::PlainSyncDecorator::new(zmq_drain); | //let zmq_decorator = slog_term::PlainSyncDecorator::new(zmq_drain); | ||||
//let zmq_fuse = slog_term::FullFormat::new(zmq_decorator).build().fuse(); | //let zmq_fuse = slog_term::FullFormat::new(zmq_decorator).build().fuse(); | ||||
@@ -445,6 +445,7 @@ mod tests { | |||||
use super::*; | use super::*; | ||||
#[test] | #[test] | ||||
#[ignore] | |||||
fn it_spawns_a_writer_thread_and_sends_dummy_measurement_to_influxdb() { | fn it_spawns_a_writer_thread_and_sends_dummy_measurement_to_influxdb() { | ||||
let ctx = zmq::Context::new(); | let ctx = zmq::Context::new(); | ||||
let socket = push(&ctx).unwrap(); | let socket = push(&ctx).unwrap(); | ||||
@@ -722,10 +722,17 @@ mod tests { | |||||
use test::{black_box, Bencher}; | use test::{black_box, Bencher}; | ||||
#[test] | #[test] | ||||
#[ignore] | |||||
fn it_creates_a_logger() { | fn it_creates_a_logger() { | ||||
let wm = WarningsManager::new("rust-test"); | let wm = WarningsManager::new("rust-test"); | ||||
let im = influx::writer(wm.tx.clone()); | let im = influx::writer(wm.tx.clone()); | ||||
let drain = WarningsDrain { tx: Arc::new(Mutex::new(wm.tx.clone())), drain: slog::Discard }; | |||||
let drain = | |||||
WarningsDrain { | |||||
tx: Arc::new(Mutex::new(wm.tx.clone())), | |||||
drain: slog::Discard, | |||||
to_file: Logger::root(slog::Discard, o!()), | |||||
level: Level::Trace, | |||||
}; | |||||
let logger = slog::Logger::root(drain, o!()); | let logger = slog::Logger::root(drain, o!()); | ||||
//for _ in 0..60 { | //for _ in 0..60 { | ||||
// debug!(logger, "test 123"; "exchange" => "plnx"); | // debug!(logger, "test 123"; "exchange" => "plnx"); | ||||
@@ -756,7 +763,7 @@ mod tests { | |||||
}); | }); | ||||
tx.lock().unwrap().send(Msg::Terminate); | tx.lock().unwrap().send(Msg::Terminate); | ||||
let len = worker.join().unwrap(); | let len = worker.join().unwrap(); | ||||
println!("{}", len); | |||||
//println!("{}", len); | |||||
} | } | ||||
} | } |