| Crates.io | togglog |
| lib.rs | togglog |
| version | 0.1.0 |
| created_at | 2025-03-01 20:15:36.582339+00 |
| updated_at | 2025-03-01 20:15:36.582339+00 |
| description | A compile-time toggle wrapper for the log crate |
| homepage | |
| repository | https://github.com/recatek/togglog |
| max_upload_size | |
| id | 1573989 |
| size | 17,126 |
A compile-time toggle wrapper for the log crate.
Add togglog to your dependencies as if it was the log crate:
[dependencies]
log = { version = "0.1", package = "togglog" }
and enable it via features:
[features]
enable_log = ["log/enabled"]
then, in your code, use log macros normally:
if bad_thing {
log::error!("bad thing!");
}
To compile out all logging, disable the log/enabled feature.
This library may be used under your choice of the Apache 2.0 or MIT license.