Class: Crashdesk::Crashlog
- Inherits:
-
Object
- Object
- Crashdesk::Crashlog
- Defined in:
- lib/crashdesk/crashlog.rb
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
Returns the value of attribute backtrace.
-
#context ⇒ Object
Returns the value of attribute context.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#exception ⇒ Object
Returns the value of attribute exception.
-
#exception_class ⇒ Object
Returns the value of attribute exception_class.
-
#exception_message ⇒ Object
Returns the value of attribute exception_message.
-
#occured_at ⇒ Object
Returns the value of attribute occured_at.
-
#options ⇒ Object
Returns the value of attribute options.
-
#reporters ⇒ Object
Returns the value of attribute reporters.
Instance Method Summary collapse
- #crc ⇒ Object
-
#initialize(exception, request, context, options = {}) ⇒ Crashlog
constructor
A new instance of Crashlog.
- #report ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(exception, request, context, options = {}) ⇒ Crashlog
Returns a new instance of Crashlog.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/crashdesk/crashlog.rb', line 9 def initialize(exception, request, context, = {}) self. = # Anatomy of Exception self.exception = exception self.backtrace = Crashdesk::Backtrace.parse(exception.backtrace || caller) self.exception_class = exception.class.name self. = exception. # Environment self.environment = Crashdesk::Environment.new( :environment_name => [:environment_name], :project_root => config.project_root) # Context self.context = context self.occured_at = Time.now.utc.iso8601 # How to report? self.reporters = [:reporters] || config.reporters end |
Instance Attribute Details
#backtrace ⇒ Object
Returns the value of attribute backtrace.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def backtrace @backtrace end |
#context ⇒ Object
Returns the value of attribute context.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def context @context end |
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def environment @environment end |
#exception ⇒ Object
Returns the value of attribute exception.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def exception @exception end |
#exception_class ⇒ Object
Returns the value of attribute exception_class.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def exception_class @exception_class end |
#exception_message ⇒ Object
Returns the value of attribute exception_message.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def end |
#occured_at ⇒ Object
Returns the value of attribute occured_at.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def occured_at @occured_at end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def end |
#reporters ⇒ Object
Returns the value of attribute reporters.
5 6 7 |
# File 'lib/crashdesk/crashlog.rb', line 5 def reporters @reporters end |
Instance Method Details
#crc ⇒ Object
53 54 55 |
# File 'lib/crashdesk/crashlog.rb', line 53 def crc backtrace.crc end |
#report ⇒ Object
48 49 50 51 |
# File 'lib/crashdesk/crashlog.rb', line 48 def report report_manager = Crashdesk::ReportManager.new(reporters) report_manager.process(self) end |
#to_hash ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/crashdesk/crashlog.rb', line 31 def to_hash { :app_key => Crashdesk.configuration.app_key, :hash_id => backtrace.hash_id, :crc => backtrace.crc, :occured_at => occured_at, :environment => environment.to_hash, :backtrace => backtrace.to_a, :exception_class => self.exception_class, :exception_message => self., :context => context.to_hash } end |