Our DeferredLog
class currently requires that the switchTo
method is called as soon as the real log is available. This makes it hard for a class to use the DeferredLog
without also being aware of when it can switch.
We should add a DeferredLogFactory
interface that can be injected into classes that need to perform deferred logging, but don't necessarily know when they can switch to the real log.