Extract setupWithLogger.