feat: implement montauk::service_log & add support to system services
This commit is contained in:
@@ -6,8 +6,10 @@
|
||||
|
||||
#include <montauk/config.h>
|
||||
#include <montauk/ntp.h>
|
||||
#include <montauk/service_log.h>
|
||||
#include <montauk/string.h>
|
||||
#include <montauk/syscall.h>
|
||||
#include <libc/stdio.h>
|
||||
|
||||
static constexpr uint64_t RETRY_INTERVAL_MS =
|
||||
montauk::ntp::MIN_QUERY_INTERVAL_MS;
|
||||
@@ -15,9 +17,9 @@ static constexpr uint64_t SYNC_INTERVAL_MS = 60ULL * 60ULL * 1000ULL;
|
||||
static constexpr uint64_t CONFIG_POLL_MS = 5000;
|
||||
|
||||
static void log(const char* message) {
|
||||
montauk::print("ntp: ");
|
||||
montauk::print(message);
|
||||
montauk::print("\n");
|
||||
char line[256];
|
||||
snprintf(line, sizeof(line), "ntp: %s", message);
|
||||
montauk::service_log(line);
|
||||
}
|
||||
|
||||
static bool load_settings(char* server, int server_cap) {
|
||||
|
||||
Reference in New Issue
Block a user