@@ -1,19 +1,25 @@ | |||||
[package] | [package] | ||||
name = "logging" | name = "logging" | ||||
version = "0.4.0" | |||||
version = "0.4.1" | |||||
authors = ["Jonathan Strong <jstrong@legis.io>"] | authors = ["Jonathan Strong <jstrong@legis.io>"] | ||||
[[example]] | |||||
name = "zmq-logger" | |||||
path = "examples/zmq-logger.rs" | |||||
required-features = ["warnings"] | |||||
[[example]] | |||||
name = "hist-interval" | |||||
path = "examples/hist-interval.rs" | |||||
[dependencies] | [dependencies] | ||||
zmq = "0.8" | zmq = "0.8" | ||||
influent = "0.4" | influent = "0.4" | ||||
chrono = { version = "0.4", features = ["serde"] } | chrono = { version = "0.4", features = ["serde"] } | ||||
hyper = "0.10" | hyper = "0.10" | ||||
termion = "1.4.0" | termion = "1.4.0" | ||||
# pub-sub = "2.0" | |||||
slog = "2.0.6" | slog = "2.0.6" | ||||
# sloggers = "0.2" | |||||
slog-term = "2" | slog-term = "2" | ||||
# chashmap = "2" | |||||
ordermap = "0.3" | ordermap = "0.3" | ||||
fnv = "1" | fnv = "1" | ||||
uuid = { version = "0.5", features = ["serde", "v4"] } | uuid = { version = "0.5", features = ["serde", "v4"] } | ||||
@@ -39,3 +45,4 @@ washington = [] | |||||
scholes = [] | scholes = [] | ||||
no-influx-buffer = [] | no-influx-buffer = [] | ||||
disable-short-uuid = [] | disable-short-uuid = [] | ||||
warnings = [] |
@@ -24,6 +24,7 @@ use decimal::d128; | |||||
use uuid::Uuid; | use uuid::Uuid; | ||||
use super::{nanos, file_logger, LOG_LEVEL}; | use super::{nanos, file_logger, LOG_LEVEL}; | ||||
#[cfg(feature = "warnings")] | |||||
use warnings::Warning; | use warnings::Warning; | ||||
const WRITER_ADDR: &'static str = "ipc:///tmp/mm/influx"; | const WRITER_ADDR: &'static str = "ipc:///tmp/mm/influx"; | ||||
@@ -511,6 +512,7 @@ pub fn serialize_owned(measurement: &OwnedMeasurement, line: &mut String) { | |||||
} | } | ||||
} | } | ||||
#[cfg(feature = "warnings")] | |||||
#[deprecated(since="0.4", note="Replace with InfluxWriter")] | #[deprecated(since="0.4", note="Replace with InfluxWriter")] | ||||
pub fn writer(warnings: Sender<Warning>) -> thread::JoinHandle<()> { | pub fn writer(warnings: Sender<Warning>) -> thread::JoinHandle<()> { | ||||
thread::Builder::new().name("mm:inflx-wtr".into()).spawn(move || { | thread::Builder::new().name("mm:inflx-wtr".into()).spawn(move || { | ||||
@@ -861,7 +863,7 @@ mod tests { | |||||
}); | }); | ||||
} | } | ||||
#[cfg(feature = "warnings")] | |||||
#[test] | #[test] | ||||
#[ignore] | #[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() { | ||||
@@ -37,6 +37,7 @@ use sloggers::file::FileLoggerBuilder; | |||||
use slog::Drain; | use slog::Drain; | ||||
pub mod influx; | pub mod influx; | ||||
#[cfg(feature = "warnings")] | |||||
pub mod warnings; | pub mod warnings; | ||||
pub mod latency; | pub mod latency; | ||||
pub mod hist; | pub mod hist; | ||||
@@ -74,12 +75,6 @@ pub fn truncating_file_logger(path: &str, level: Severity) -> slog::Logger { | |||||
builder.build().unwrap() | builder.build().unwrap() | ||||
} | } | ||||
// #[cfg(any(test, feature = "test"))] | |||||
// pub fn file_logger(_: &str, _: Severity) -> slog::Logger { | |||||
// use slog::*; | |||||
// Logger::root(Discard, o!()) | |||||
// } | |||||
#[deprecated(since="0.4.0", note="Turns out the file logger in sloggers uses async, \ | #[deprecated(since="0.4.0", note="Turns out the file logger in sloggers uses async, \ | ||||
making the async here duplicative")] | making the async here duplicative")] | ||||
pub fn async_file_logger(path: &str, level: Severity) -> slog::Logger { | pub fn async_file_logger(path: &str, level: Severity) -> slog::Logger { | ||||