config-rs icon indicating copy to clipboard operation
config-rs copied to clipboard

log::Level not deserializable in 0.10.0

Open Yatekii opened this issue 4 years ago • 6 comments

I use log::Level in my config structs and this works great with config 0.9.0 and the serde feature enabled on the log crate (v 0.4.0).

In version 0.10.0 I get enum Level does not have variant constructor Error', src/config/mod.rs:7:37 for every variant of the Level enum I try.

Yatekii avatar Apr 18 '20 19:04 Yatekii

ERROR will work.

This is a pretty serious issue for me too, there was a lot of breakage in 0.10 around case-sensitivity.

saethlin avatar Jul 14 '20 17:07 saethlin

Do I understand correctly that this is only due to case sensitivity, but there is no real bug here? If that's the case, I'd close this issue.

matthiasbeyer avatar Mar 19 '21 09:03 matthiasbeyer

I consinder this a bug tbh.

a) Why would it be case sensitive? b) Why make this change? Enum variants are CapsCamelCase and not SCREAM_CASE.

But ofc. It is your choice :)

Yatekii avatar Mar 19 '21 10:03 Yatekii

Hm. I'm not sure that's a bug in config-rs, is it? :confused:

matthiasbeyer avatar Mar 26 '21 16:03 matthiasbeyer

Define "bug". It is something in config-rs. https://docs.rs/log/0.4.14/src/log/lib.rs.html#513 log itself can parse it from any case.

Yatekii avatar Mar 26 '21 21:03 Yatekii

Ok cool, I'll have a look!

matthiasbeyer avatar Mar 26 '21 22:03 matthiasbeyer

I am closing this, after #188 was merged and I think this issue is resolved. Feel free to comment and I'll reopen if necessary.

matthiasbeyer avatar Nov 28 '22 17:11 matthiasbeyer