Copy of http://brenwill.com/2010/flexible-ios-logging/