Refactored pip freeze logging