Implement log levels

This commit is contained in:
Juno Takano 2026-01-15 03:37:45 -03:00
commit 874cac2df1
25 changed files with 497 additions and 223 deletions

View file

@ -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() {

View file

@ -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 {

View file

@ -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
},
};

View file

@ -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))
}
}