Crate path:LogLevel error

#1

I’m working to a project in Rust and I’m finding a problem with the crate of “path”.
In particular, there is a problem in import of LogLevel; this is the error:

error[E0432] : unresolved import log::LogLevel

How can I do?
Thanks

#2

Do you have the log in your Cargo.toml?

1 Like
#3

Yes, but not find LogLevel

#4

The problem is that path doesn’t specify which exact version of log it needs. Cargo selects the latest version by default, but path only works with an older version.

You may be able to work around this by running a command like cargo update -p log --precise 0.3.9, if path is the only crate in your project that depends directly on log. (If not, the workaround might be trickier.)

The real fix is to add better dependency info to the path crate.

2 Likes
#5

Thanks for your help. :laughing: