mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
* Automatically track subloggers in allLoggers This PR introduces a new interface called `SubloggerAdder` for tracking allLoggers across startup phases. The interface enables us to register a single `SubloggerHook` during initial logger creation and hand off management of `allLoggers` during the three phases we need to handle: - Before `CoreConfig` is created, the `SubloggerHook` (`AppendToAllLoggers`) appends new subloggers to `ServerCommand.allLoggers`. - After `CoreConfig` is created and before `NewCore` returns, new subloggers are added to `CoreConfig.AllLoggers`. Intermediate state must also be kept in sync within NewCore to track new subloggers before we return to the server command and register the `Core.SubloggerAdder` implementation. - After `NewCore` returns to the server command, we register Core as the implementer of `ServerCommand.SubloggerAdder` ensuring that all new subloggers are appended to `Core.allLoggers`. * Wire up the sublogger hook in NewTestLogger