[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

@@ -22,7 +22,7 @@ extern "C" {
int
main(int argc, const char **argv, const char **env)
{
j6::syslog("fb driver starting");
j6::syslog(j6::logs::srv, j6::log_level::info, "fb driver starting");
using bootproto::devices::uefi_fb;
using bootproto::devices::video_mode;
@@ -32,7 +32,7 @@ main(int argc, const char **argv, const char **env)
const uefi_fb *fb = reinterpret_cast<const uefi_fb*>(init->argv[0]);
if (!fb || !fb->framebuffer) {
j6::syslog("fb driver didn't find a framebuffer, exiting");
j6::syslog(j6::logs::srv, j6::log_level::error, "fb driver didn't find a framebuffer, exiting");
return 1;
}
@@ -104,7 +104,7 @@ main(int argc, const char **argv, const char **env)
buffer_size = size;
continue;
} else if (s != j6_status_ok) {
j6::syslog("fb driver got error from get_log, quitting");
j6::syslog(j6::logs::srv, j6::log_level::error, "fb driver got error from get_log, quitting");
return s;
}
@@ -130,6 +130,6 @@ main(int argc, const char **argv, const char **env)
}
}
j6::syslog("fb driver done, exiting");
j6::syslog(j6::logs::srv, j6::log_level::info, "fb driver done, exiting");
return 0;
}