Extract conditions for showing stacktraces to a method.