Implement log levels
This commit is contained in:
parent
2cdf68082a
commit
874cac2df1
25 changed files with 497 additions and 223 deletions
|
|
@ -161,7 +161,7 @@ impl Parseable for Anchor {
|
|||
|
||||
impl std::fmt::Display for Anchor {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
use crate::dev::wrap;
|
||||
use crate::log::wrap;
|
||||
|
||||
let wrapped_text = wrap(&self.text);
|
||||
let display_text = if wrapped_text.is_empty() {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ impl Parseable for CheckBox {
|
|||
|
||||
fn lex(lexeme: &Lexeme) -> CheckBox {
|
||||
use crate::prelude::*;
|
||||
log!("Lexing: {lexeme}");
|
||||
log!(VERBOSE, "Lexing: {lexeme}");
|
||||
if lexeme.match_next_char('x') {
|
||||
CheckBox::new(true)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ impl From<usize> for Level {
|
|||
let u8 = match u8::try_from(z) {
|
||||
Ok(u) => u,
|
||||
Err(e) => {
|
||||
log!("Truncating header level {z} to 6: {e:?}");
|
||||
log!(INFO, "Truncating header level {z} to 6: {e:?}");
|
||||
6
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ impl Parseable for Literal {
|
|||
|
||||
impl std::fmt::Display for Literal {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(f, "Literal {}", crate::dev::wrap(&self.text))
|
||||
write!(f, "Literal {}", crate::log::wrap(&self.text))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue