Fix logging messages not shown in hooks ``pytest_sessionstart()`` and ``pytest_sessionfinish()``.