Utility for logging lines of code from a string