1
0
Fork 0
forked from AbleOS/ableos
ableos/sysdata/libraries/stn/src/log.hb

14 lines
531 B
Plaintext
Raw Normal View History

2024-09-18 03:38:49 -05:00
string := @use("string.hb")
2024-07-07 08:35:07 -05:00
2024-10-15 18:03:23 -05:00
log := fn($Level: u8, message: ^u8): void {
message_length := @inline(string.length, message);
2024-10-15 18:03:23 -05:00
*(message + message_length) = Level
2024-09-17 12:08:19 -05:00
return @eca(3, 1, message, message_length + 1)
2024-07-07 08:35:07 -05:00
}
2024-10-15 18:03:23 -05:00
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)