🎉 Release BitLogger v0.1.0 core

This commit is contained in:
Nanaloveyuki
2026-05-08 14:18:27 +08:00
parent d8687a8371
commit ff3d32a26a
16 changed files with 558 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
pub(all) enum Level {
Trace
Debug
Info
Warn
Error
}
fn Level::priority(self : Level) -> Int {
match self {
Level::Trace => 10
Level::Debug => 20
Level::Info => 30
Level::Warn => 40
Level::Error => 50
}
}
pub fn Level::label(self : Level) -> String {
match self {
Level::Trace => "TRACE"
Level::Debug => "DEBUG"
Level::Info => "INFO"
Level::Warn => "WARN"
Level::Error => "ERROR"
}
}
fn Level::enabled(self : Level, min_level : Level) -> Bool {
self.priority() >= min_level.priority()
}