Skip to main content

check_log

Function check_log 

Source
pub fn check_log(log: &str) -> Vec<Error>
Expand description

An mdbook error for each ERROR line of the log of mdbook.

let log = " INFO Book building has started\n\
           ERROR Error updating \"{{#include gone.rs}}\", Could not read file\n\
            WARN Caused By: No such file or directory (os error 2)\n";
let errors = hygiene::book::check_log(log);
assert_eq!(errors.len(), 1);
assert_eq!(errors[0].rule, "mdbook");
assert!(errors[0].text.starts_with("ERROR Error updating"));