Function simple_log::update_log_level
source · [−]pub fn update_log_level<S: Into<String>>(level: S) -> SimpleResult<LogConfig>
Expand description
update simple-log global config log level.
Examples
fn main() -> Result<(), String> {
use simple_log::{LogConfigBuilder, update_log_level, log_level};
let config = LogConfigBuilder::builder()
.path("./log/builder_log.log")
.size(1 * 64)
.roll_count(10)
.level("debug")
.output_file()
.output_console()
.build();
simple_log::new(config)?;
//update log level
let config = update_log_level(log_level::DEBUG)?;
assert_eq!("debug",config.get_level());
Ok(())
}