feat: implement montauk::service_log & add support to system services
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user