added some code to use logex with sys.excepthook

Signed-off-by: Tobias Hommel <github@genoetigt.de>