function params = set_verbosity(params,verbosity)

if verbosity == -1
  % do nothing
  return
end

if verbosity == 0
  params.debug.iterdisp=0;
end

if verbosity >= 1
  params.debug.iterdisp = 10;
  params.debug.dispFailedNewtonStep = true;
end

if verbosity >= 2
  params.debug.iterplot = 1;
  params.debug.iterdisp = 1;
  params.debug.plotFailedNewtonStep = true;
end

if verbosity >= 3
  params.debug.plotEachNewtonStep = true;
end

if verbosity >= 4
  params.debug.pauseEachNewtonStep = true;
end

if verbosity >= 5
  params.debug.plotEachNewtonDirection = true;
end

if verbosity >= 6
  params.debug.checkstateequation = true;
end

if verbosity >= 7
  params.debug.checkprofilejacobians = true;
  params.debug.trapProfilesToCheck = {'all'};
  params.debug.stapProfilesToCheck = {'all'};
end

if verbosity >= 8
  params.debug.plotprofilejacobians = true;
end

end