1
0
Fork 0
forked from AbleOS/ableos
ableos_time/sysdata/libraries/stn/src/log.hb
2024-09-18 10:38:49 +02:00

15 lines
513 B
Plaintext

string := @use("string.hb")
buffer := @use("buffer.hb")
log := fn(message: ^u8, level: u8): void {
message_length := @inline(string.length, message);
*(message + message_length) = level
return @eca(3, 1, message, message_length + 1)
}
error := fn(message: ^u8): void return log(message, 0)
warn := fn(message: ^u8): void return log(message, 1)
info := fn(message: ^u8): void return log(message, 2)
debug := fn(message: ^u8): void return log(message, 3)
trace := fn(message: ^u8): void return log(message, 4)