added flag to toggle logging in idealcontroller