Print debugging information at development time
What does this library do?
- Print nice debugging information;
- Does not affect performance in the release version;
Usage
Add this to your Cargo.toml
:
[]
= { = "0.1.0", = ["debug"] }
Use the develop_debug!
:
use *;
let x = "dear X";
let say = "hello world!";
let array = vec!;
let title2 = "balabala...";
develop_debug!;
develop_debug!;
develop_debug!;
develop_debug!;
develop_debug!;
develop_debug!;
Output:
๐ example
๐ balabala...
๐ท โน x โบ = โนdear Xโบ
๐ท โน say โบ = โนhello world!โบ
๐ถ array.iter()
๐ธ "a"
๐ธ "b"
๐ธ "c"
๐ฑ done.
๐ฑ genius!
๐ฅ error.
๐ฅ dude, this road is blocked.
๐ฐ Use it just as you would with the `println!()` macro.
Using the develop_debug!
shortcut, print the same output as above :
use *;
let x = "dear X";
let say = "hello world!";
let array = vec!;
let title2 = "balabala...";
dd___title!;
dd_____var!;
dd____iter!;
dd____done!;
dd___error!;
dd________!;
What are the benefits of develop_debug!
shortcut?
๐ฌ I think it's easy to recognize in the source code ;
๐คค I think it's convenient to prompt in VS Code
;
๐ค I think it visually splits up the code ;
How do development debug macros affect the code in the release?
๐ฌ Add this to your Cargo.toml
when developing :
[]
= { = "0.1.0", = ["debug"] }
๐ค Modify Cargo.toml
when you are ready to release :
[]
= { = "0.1.0" }
- There is no need to clear debugging methods from source code;
- The
develop_debug!
macro expands to empty; - It doesn't affect code performance at all;
If the document is not semantically fluent
๐ฅบ, please forgive my lack of English. All the documents are explained by the translation software; If you can provide a better translation, please contact me at code@autodo.xyz;
I hope this simple library is of some help to you.
Some amazing mistakes are not mistakes
After switching features, then execute cargo
to report an error:
# The solution
# Switch features, and then
# Clear old compiled content
# Execute the required command
)