1
0
Fork 0
forked from AbleOS/ableos
ableos/sysdata/libraries/stn/src/log.hb
2024-10-16 00:03:23 +01:00

14 lines
531 B
Plaintext

string := @use("string.hb")
log := fn($Level: u8, message: ^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 @inline(log, 0, message)
warn := fn(message: ^u8): void return @inline(log, 1, message)
info := fn(message: ^u8): void return @inline(log, 2, message)
debug := fn(message: ^u8): void return @inline(log, 3, message)
trace := fn(message: ^u8): void return @inline(log, 4, message)