[libj6] Add log area and severity to j6::syslog()

User code can now set the log area and severity of log messages. This also updates the j6_log
syscall to take these parameters, but removes all calls to it except through j6::syslog().
This commit is contained in:
Justin C. Miller
2024-02-24 13:39:24 -08:00
parent a1e2c58afc
commit bc46c9a7d5
22 changed files with 114 additions and 77 deletions

View File

@@ -21,10 +21,11 @@ namespace syscalls {
using system = class ::system;
j6_status_t
log(const char *message)
log(uint8_t area, uint8_t severity, const char *message)
{
thread &th = thread::current();
log::info(logs::syscall, "Message <%02lx:%02lx>: %s", th.parent().obj_id(), th.obj_id(), message);
log::log(static_cast<logs>(area), static_cast<log::level>(severity),
"<%02lx:%02lx>: %s", th.parent().obj_id(), th.obj_id(), message);
return j6_status_ok;
}