Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: How do I execute code based on the build type (release or debug)
So I need to execute code based on the build type (release or debug).
For example I need to call function A for release binaries and function B for debug binaries.
Essentially I'm just logging variables and events.
So far this is what I have:
#[cfg(debug_assertions)]
{
println!("Config: {:#?}", config);
println!("-------");
}
I have seen that some sources suggest using the log crate.
I really don't want to add unnecessary dependencies just to solve a simple problem.
So I'm asking for help here
3 posts - 3 participants
🏷️ Rust_feed