FateRegistry
The set of FateBackends that logged values are routed to, plus the time source that stamps them.
Most code uses Fate, which wraps one shared registry. This is a class so a test can build its own with a kotlin.time.TestTimeSource and a MockFateBackend without affecting anything else.
Timestamps
Every value is stamped in nanoseconds with the time elapsed on timeSource since the registry was created or last restarted. Only differences between stamps mean anything.
Backends
Every registered backend receives every value. Backends can change while other threads are logging. A table notices the change on its next log and rebuilds its entries against the new set.
Warnings
Telemetry reports a wrong type, a schema it can't infer, or a backend that threw through warningHandler, then carries on. A logging mistake should not end a match. Each distinct message is reported once, so a bad value logged every loop does not flood the output.
Properties
How many backends are registered.
Stamps every logged value. Defaults to TimeSource.Monotonic.
Where warnings go. The default prints to standard error. A handler must not throw, and may be called from any thread.
Functions
Adds backend. It receives every value logged after this call, including on paths that were already being logged.
Makes the next timestamp count from zero again.
Removes backend without closing it.
Reports message to warningHandler, unless this exact message has been reported before. After 1000 distinct messages, new ones are dropped.