Thanks for the response. Logging doesn't seem to be an issue then, nice.
I'm still curious as to how to introduce variations though.
Frequently we find that we have to introduce "if (settings['special_x']) then DoSpecial else DoCommon" deep in the business logic to handle special cases that arise.
Assuming the existing function did not depend on the settings, how does one best introduce this dependency on the settings? In our code base we can cheat by effectively having the "settings" dictionary as a global variable, though we try to minimize this obviously. But in a pinch at 4am, that might be enough.
How about Haskell, is there a way to "inject" such settings without refactoring all the way to the top?