Closed CAD97 closed 6 years ago
We are just using the environment variable Cargo gives us here.
Is there something we can do differently here without a build script or proc macro?
I'm now using env!("CARGO_PKG_NAME").replace("-","_")
(mod typing that on a phone without checking syntax) which works properly for the common case of one crate in the package
No idea what to do for workspaces until cargo provides more info
This was very weird to diagnose, since I couldn't figure out why it worked in
playground
but not in my real project (that has hyphens in its name) until I guessed that this was the problem.When setting
package.name = "crate-name"
, the actual crate name will becrate_name
. The log filter should be registered forcrate_name
but is currently registered forcrate-name
. (It may be a failing ofenv_logger
to not accept either, but we can do better.)