hold static method
Holds back every record from now on, of any level, until SpringLogHold.release emits those that pass the levels of that time.
It is for startup code that logs before the levels are known:
SpringApplication holds the records logged before the
logging.level.* properties are applied, like Spring Boot's
DeferredLog. Applications rarely call it.
While a hold is active every level is enabled (isEnabled is true)
and records reach neither handler nor the listeners. Holds nest:
releasing an inner one passes its records to the outer one.
final hold = SpringLog.hold();
log.debug('early'); // held
SpringLog.setLevel('neon', SpringLogLevel.debug);
hold.release(); // emits 'early' now
Implementation
static SpringLogHold hold() {
final hold = SpringLogHold._();
_holds.add(hold);
return hold;
}