Enable log levels

    0

    0

    Giovanny Gongora

    Codiga's Rust Recipes

    define different log levels

    mod foo {
      mod bar {
        pub fn run() {
          log::warn!("[bar] warn");
          log::info!("[bar] info");
          log::debug!("[bar] debug");
        }
      }
      pub fn run() {
        log::warn!("[foo] warn");
        log::info!("[foo] info");
        log::debug!("[foo] debug");
        bar::run();
      }
    }
    fn main() {
      env_logger::init();
      log::warn!("[root] warn");
      log::info!("[root] info");
      log::debug!("[root] debug");
      foo::run();
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.