Python logging helper functions