how to test logging in python