Class: Ayadn::Debug
Class Method Summary collapse
- .err(error, stack) ⇒ Object
- .http(response, url) ⇒ Object
- .skipped(dic) ⇒ Object
- .stream(stream, options, target) ⇒ Object
Class Method Details
.err(error, stack) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ayadn/debug.rb', line 25 def self.err error, stack # Logs.rec.debug "+DEBUG STACK: #{stack}" if Settings..timeline.debug puts "\nDEBUG:\n" puts error.inspect raise error # puts "\nSTACK:\n" # puts stack # puts "\n--*--\n\n" end end |
.http(response, url) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ayadn/debug.rb', line 11 def self.http response, url if Settings..timeline.debug deb = "\n" deb << "+ HTTP\n" deb << "* t#{Time.now.to_i}\n" deb << "Url: #{url}\n" deb << "Code: #{response.code}\n" deb << "\n" puts deb.color(:green) Logs.rec.debug "HTTP/URL: #{url}" Logs.rec.debug "HTTP/HEADERS: #{response.headers}" end end |
.skipped(dic) ⇒ Object
5 6 7 8 9 |
# File 'lib/ayadn/debug.rb', line 5 def self.skipped dic if Settings..timeline.debug Logs.rec.debug "SKIPPED: #{dic.keys.first.to_s.capitalize} => #{dic.values.first}" end end |
.stream(stream, options, target) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/ayadn/debug.rb', line 37 def self.stream(stream, , target) if Settings..timeline.debug deb = "\n" deb << "+ STREAM\n" deb << "* t#{Time.now.to_i}\n" deb << "Options:\t#{.inspect}\n" deb << "Target:\t\t#{target.inspect}\n" deb << "Posts:\t\t#{stream.posts.length}\n" deb << "Meta:\t\t#{stream..input.inspect}\n" deb << "\n" puts deb.color(Settings..colors.debug) Logs.rec.debug "STREAM/META: #{stream..input.inspect}" Logs.rec.debug "STREAM/OPTIONS: #{.inspect}" Logs.rec.debug "STREAM/TARGET: #{target.inspect}" Logs.rec.debug "STREAM/POSTS: #{stream.posts.length}" end end |