Allow logging to be disabled

This is a somewhat nontraditioonal use of features, but I don't want to
make logging opt in.

Closes #215
This commit is contained in:
Steven Fackler 2016-11-08 21:51:24 +00:00
parent a624abc557
commit d99843ba91
3 changed files with 13 additions and 0 deletions

View File

@ -31,6 +31,8 @@ with-serde_json = ["serde_json"]
with-time = ["time"]
with-uuid = ["uuid"]
no-logging = []
[dependencies]
bufstream = "0.1"
fallible-iterator = "0.1.3"

View File

@ -73,6 +73,7 @@
extern crate bufstream;
extern crate fallible_iterator;
extern crate hex;
#[cfg(not(feature = "no-logging"))]
#[macro_use]
extern crate log;
extern crate phf;

View File

@ -25,3 +25,13 @@ macro_rules! bad_response {
return Err(::error::Error::Io(::bad_response()));
})
}
#[cfg(feature = "no-logging")]
macro_rules! debug {
($($t:tt)*) => {}
}
#[cfg(feature = "no-logging")]
macro_rules! info {
($($t:tt)*) => {}
}