Skip to content
Seamus Tuohy edited this page Apr 23, 2014 · 1 revision

Crash Reporter

The crash reporter handles GUI crashes by providing a user window with crash info and reporting options as well as handling the compilation of the crash report. The crash reported exposes two signals for managing crash report collection. It will emit a signal through crash_override to let the system know that it has encountered a crash. Once it has emitted a crash_override signal it will then connect a collector function to its crash_info signal.

Within the main window objects can be connected to the crash reporter as such. The following uses a module with a crash data collection signal named "data_report" to send crash_reports and "start_report_collection" to start collection.

#just creating the object
self.module = MyModule() 

#crash reporting starts here
#connect crash reporter alerts to the modules report creator
self.crash_report.crash_override.connect(self.module.start_report_collection) 
#connect the modules report emitter to the crash report report collector
self.module.data_report.connect(self.crash_report.crash_info)

A crash report sent to the crash reporter consists of two arguments. A string with the name of the modules and a dictionary containing a key, value pairs of the information that component will need.

"module_name", {"value name 01" = "value", "value name 02" = "value", "value name 03" = "value"}

The signal emiter will look somthing like this.

self.mySignal.emit("myModule", {"value name 01" = "value", "value name 02" = "value", "value name 03" = "value"})

The final report will take the values from all crash reports the reporter received in the request period and compile them into a dictionary.

{"section name 1" = {"value name 01" = "value", "value name 02" = "value", "value name 03" = "value"},

"section name 2" = {"value name 01" = "value", "value name 02" = "value", "value name 03" = "value"},

"section name 3" = {"value name 01" = "value", "value name 02" = "value", "value name 03" = "value"},

"section name 4" = {"value name 01" = "value", "value name 02" = "value", "value name 03" = "value"}}

That dictionary gets created into a user-readable crash report that looks like this.

=====  Error========

This is the error that the user encountered that started this whole mess.

Traceback (most recent call last):
  File "<doctest...>", line 10, in <module>
    lumberjack()
  File "<doctest...>", line 4, in lumberjack
    bright_side_of_death()
    
=====  system info=======

version = 1.0
endian = little endian
arch_size =  64bit

=====  section name 1 =======

value name 01 = value
value name 02 = value
value name 03 = value

=====  section name 2 =======

value name 01 = value
value name 02 = value
value name 03 = value

=====  section name 3 =======

value name 01 = value
value name 02 = value
value name 03 = value

=====  section name 4 =======

value name 01 = value
value name 02 = value
value name 03 = value


attached: log_report