Skip to content

Make femme dependency optional#693

Merged
Fishrock123 merged 1 commit intohttp-rs:mainfrom
rossmacarthur:fix/femme-dep
Sep 29, 2020
Merged

Make femme dependency optional#693
Fishrock123 merged 1 commit intohttp-rs:mainfrom
rossmacarthur:fix/femme-dep

Conversation

@rossmacarthur
Copy link
Contributor

Description

Make the femme dependency optional, enabled via the logger feature.

Motivation and Context

Allows you to use a different log crate and femme doesn't have to be installed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    Technically speaking this is a breaking change in the case where someone removed the logger feature and still used tide::log::LevelFilter.

Checklist:

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

It now is only installed via the `logger` feature. In order to do this
we need the `std` feature from `log` crate.
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

@Fishrock123
Copy link
Member

merging as is for now, yosh will have to address the kv-log-macro thing some other time.

@Fishrock123 Fishrock123 merged commit 8d27871 into http-rs:main Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants