Python debug logging helper