Python logging with string formatting issue