Only the level-restore half of close() was pinned before this
(WorktreeSessionManagerTest). Deleting logger.detachAppender(appender)
from close() left mvn clean install green (1701 tests, 0 failures) --
the appender-detach half of the contract was unmeasured.
Adds CapturedLogTest with three tests, each using a logger name no
production class uses:
- closeDetachesTheAppenderSoALaterLogIsNotCaptured: an event logged
after close() must not land in events().
- closeRestoresTheLevelCapturedAtOpen: the helper's headline contract
in one place, independent of any production class.
- setLevelDuringCaptureDoesNotChangeWhatCloseRestores: setLevel()'s
own javadoc claim that close() always restores the level captured
at construction, never a value set through setLevel() mid-capture.
Test-only change; CapturedLog.java itself is untouched.