python logging fix