Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make femme dependency optional #693

Merged
merged 1 commit into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ rustdoc-args = ["--cfg", "feature=\"docs\""]
[features]
default = ["h1-server", "logger", "sessions"]
h1-server = ["async-h1"]
logger = []
logger = ["femme"]
docs = ["unstable"]
sessions = ["async-session"]
unstable = []
Expand All @@ -39,8 +39,9 @@ async-session = { version = "2.0.0", optional = true }
async-sse = "4.0.0"
async-std = { version = "1.6.0", features = ["unstable"] }
async-trait = "0.1.36"
femme = "2.0.1"
femme = { version = "2.0.1", optional = true }
futures-util = "0.3.5"
log = { version = "0.4.8", features = ["std"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Contributor Author

@rossmacarthur rossmacarthur Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the dependency tree looks like this

tide
   -- kv-log-macro
      -- log (features = ["kv_unstable"])
   -- femme
      -- log (features = ["kv_unstable", "std"])

However, tide actually relies on the std feature in the log crate being turned on. Otherwise you get the following error

 the trait `log::kv::value::ToValue` is not implemented for `std::string::String`

Ideal way to solve this is actually like this: yoshuawuyts/kv-log-macro#7

http-types = "2.2.1"
kv-log-macro = "1.0.4"
pin-project-lite = "0.1.7"
Expand Down
2 changes: 2 additions & 0 deletions src/log/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pub use kv_log_macro::{max_level, Level};

mod middleware;

#[cfg(feature = "logger")]
pub use femme::LevelFilter;

pub use middleware::LogMiddleware;

/// Start logging.
Expand Down