add logging in python snippets