lib/include/class_knjappserver_errors.rb in knjappserver-0.0.29 vs lib/include/class_knjappserver_errors.rb in knjappserver-0.0.30

- old
+ new

@@ -11,13 +11,11 @@ @error_emails_time = 5 else @error_emails_time = 180 end - self.timeout(:time => @error_emails_time) do - self.flush_error_emails - end + self.timeout(:time => @error_emails_time, &self.method(:flush_error_emails)) end #Send error-emails based on error-emails-cache (cached so the same error isnt send out every time it occurrs to prevent spamming). def flush_error_emails @error_emails_pending_mutex.synchronize do @@ -97,16 +95,16 @@ e.backtrace.each do |line| html << "#{Knj::Web.html(line)}<br />" end - html << "<br /><b>Post:</b><br /><pre>#{Knj::Php.print_r(_post, true)}</pre>" if _post - html << "<br /><b>Get:</b><br /><pre>#{Knj::Php.print_r(_get, true)}</pre>" if _get - html << "<br /><b>Server:</b><br /><pre>#{Knj::Php.print_r(_server, true).html}</pre>" if _server - html << "<br /><b>Cookie:</b><br /><pre>#{Knj::Php.print_r(_cookie, true).html}</pre>" if _meta - html << "<br /><b>Session:</b><br /><pre>#{Knj::Php.print_r(_session, true).html}</pre>" if _session - html << "<br /><b>Session hash:</b><br /><pre>#{Knj::Php.print_r(_session_hash, true).html}</pre>" if _session_hash + html << "<br /><b>Post:</b><br /><pre>#{Php4r.print_r(_post, true)}</pre>" if _post + html << "<br /><b>Get:</b><br /><pre>#{Php4r.print_r(_get, true)}</pre>" if _get + html << "<br /><b>Server:</b><br /><pre>#{Php4r.print_r(_server, true).html}</pre>" if _server + html << "<br /><b>Cookie:</b><br /><pre>#{Php4r.print_r(_cookie, true).html}</pre>" if _meta + html << "<br /><b>Session:</b><br /><pre>#{Php4r.print_r(_session, true).html}</pre>" if _session + html << "<br /><b>Session hash:</b><br /><pre>#{Php4r.print_r(_session_hash, true).html}</pre>" if _session_hash error_hash = @error_emails_pending[backtrace_hash] error_hash[:last_time] = Time.new error_hash[:messages] << html end @@ -122,10 +120,10 @@ end end #Prints a detailed overview of the object in the terminal from where the appserver was started. This can be used for debugging. def dprint(obj) - STDOUT.print Knj::Php.print_r(obj, true) + STDOUT.print Php4r.print_r(obj, true) end #Prints a string with a single file-line-backtrace prepended which is useful for debugging. def debugs(str) #Get backtrace. \ No newline at end of file