feat: implement montauk::service_log & add support to system services

This commit is contained in:
2026-08-28 11:56:29 +02:00
parent 0d23db8a0e
commit b1f1cfe32b
8 changed files with 117 additions and 62 deletions
+24
View File
@@ -0,0 +1,24 @@
/*
* service_log.h
* Common logging policy for MontaukOS userspace services.
*/
#pragma once
#include <montauk/syscall.h>
namespace montauk {
// Append one newline-free message to the system log. When the service was
// launched from a userspace terminal, echo the same message there as well.
inline void service_log(const char* message) {
if (message == nullptr) return;
write_log(message);
if (terminal_attached()) {
print(message);
print("\n");
}
}
}