add python logging traps