https://lists.pythonprogramminghelp.com/3-proven-ways-to-diagnostic-measures/