Ben Chuanlong Du's Blog

It is never too late to learn.

Rust Crate Log

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

In [2]:
:dep log = "0.4.14"
In [4]:
use log::{info, trace, warn};
In [2]:
:dep simple_logger = "1.11.0"
In [3]:
use simple_logger::SimpleLogger;
In [4]:
SimpleLogger::new().init().unwrap();
In [7]:
info!("nima");
log::info!("nima");
^^^ use of undeclared crate or module `log`
failed to resolve: use of undeclared crate or module `log`
In [6]:
warn!("what happend?");
warn!("what happend?");
^^^^ 
cannot find macro `warn` in this scope
In [ ]:

Comments