Changes

Jump to: navigation, search

Debugging Gramps

3 bytes added, 00:46, 28 June 2009
m
format
[[Category:Developers/Reference]][[Category:Developers/Tutorials]]
[[Category:Developers/General]]
 
This page gives an overview on how to debug GRAMPS.
Short: in your code add data to the logger with: log.warning(), log.error(), log.info()...
Start Gramps GRAMPS with the --debug flag: python gramps.py --debug="name_of_the_logger"
This is useful when working in different parts, adding info output, and selecting on the commandline command line with --debug the logger you want to see output with.
== Use profiling ==
GRAMPS has a convenience hook to allow you to do profiling. Profiling gives an overview how many times methods are called in a code fragment and how long each one took. It helps to find perfermance performance bottlenecks.
An example usage:
profile(self.save, *obj)
Then run grampsGRAMPS, everytime every time you save, the profiler kicks in and prints to command line a report with the time for each function.
So in short: replace the call to a function/method to calling profile with as first parameter the function/method, and other parameters the parameters of the function/method.
Try it!
 
[[Category:Developers/Reference]]
[[Category:Developers/Tutorials]]
[[Category:Developers/General]]
920
edits

Navigation menu