Last active
August 29, 2015 14:01
-
-
Save willhaslett/ae8a8674a7ddd8d0d874 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Development logging helper. Call with CG.devlog(your_stuff) | |
# message: The stuff you want printed by the server | |
# skip_header: By default, include the file, line number, and method name as a header. Override with false. | |
# newline: By default, output a blank line before the logged output. Override with false. | |
def devlog(message='', skip_header=false, newline=true) | |
puts '' if newline | |
header = skip_header ? '' : "#{caller[0].gsub(Rails.root.to_s, '').gsub(":in `", ' method:').gsub("'", '')}: " | |
puts "#{header}#{message}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment