python library logging best practices