fix: set logging env var if unset

This commit is contained in:
Aravinth Manivannan 2022-03-29 19:15:55 +05:30
parent fc8f86a2af
commit 55b7bf92bb
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
1 changed files with 6 additions and 1 deletions

View File

@ -47,7 +47,12 @@ pub const PKG_HOMEPAGE: &str = env!("CARGO_PKG_HOMEPAGE");
#[cfg(not(tarpaulin_include))]
#[actix_web::main]
async fn main() -> std::io::Result<()> {
env::set_var("RUST_LOG", "info");
{
const LOG_VAR: &str = "RUST_LOG";
if env::var(LOG_VAR).is_err() {
env::set_var("RUST_LOG", "info");
}
}
pretty_env_logger::init();