Skip to content

Instantly share code, notes, and snippets.

@mattsnyder
Created April 9, 2013 16:04
Show Gist options
  • Save mattsnyder/5346974 to your computer and use it in GitHub Desktop.
Save mattsnyder/5346974 to your computer and use it in GitHub Desktop.
Helpful method for logging output in Rake tasks
def log(string)
string.split(/\n/).each do |line|
puts "[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] #{line}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment