Debug Printing


def debug_code(title=nil, text=nil)
if $debug == true
if text and title
puts "------------- #{title} -------------"
puts text</span>
puts "------------- End #{title} -------------"
else</span>
puts "------------- Begin Debug -------------"
puts title</span>
puts "------------- End Debug -------------"
end
end
end

def debug_json_code(title=nil, text=nil)
if $debug == true
if text and title
Pry::ColorPrinter.pp "------------- #{title} -------------"
Pry::ColorPrinter.pp text
Pry::ColorPrinter.pp "------------- End #{title} -------------"
else
Pry::ColorPrinter.pp "------------- Begin Debug -------------"
Pry::ColorPrinter.pp title
Pry::ColorPrinter.pp "------------- End Debug -------------"
end
end
end

Leave a Reply

Your email address will not be published. Required fields are marked *