core: Turn manager unit log fields into unit functions

There's no need for these to be fields inside the manager struct,
let's turn them into functions in unit.h instead, again to allow
forward declaring the Manager struct in a later commit.
This commit is contained in:
Daan De Meyer
2025-04-23 09:53:53 +02:00
parent 8aa304d313
commit 64fd6ba9ca
6 changed files with 22 additions and 24 deletions
-9
View File
@@ -928,15 +928,6 @@ int manager_new(RuntimeScope runtime_scope, ManagerTestRunFlags test_run_flags,
m->timestamps + MANAGER_TIMESTAMP_LOADER);
#endif
/* Prepare log fields we can use for structured logging */
if (MANAGER_IS_SYSTEM(m)) {
m->unit_log_field = "UNIT=";
m->invocation_log_field = "INVOCATION_ID=";
} else {
m->unit_log_field = "USER_UNIT=";
m->invocation_log_field = "USER_INVOCATION_ID=";
}
/* Reboot immediately if the user hits C-A-D more often than 7x per 2s */
m->ctrl_alt_del_ratelimit = (const RateLimit) { .interval = 2 * USEC_PER_SEC, .burst = 7 };