@openzeppelin/hardhat-upgrades 's admin.transferProxyAdminOwnership() always logs success

I am testing scripts in a hardhat project, these are my dependencies (let me know if you need the lockfile)

"devDependencies": {
    "@nomicfoundation/hardhat-chai-matchers": "^2.0.6",
    "@nomicfoundation/hardhat-ethers": "^3.0.5",
    "@nomicfoundation/hardhat-network-helpers": "^1.0.10",
    "@nomicfoundation/hardhat-verify": "^2.0.4",
    "@openzeppelin/contracts": "^5.0.1",
    "@openzeppelin/contracts-upgradeable": "^5.0.1",
    "@openzeppelin/hardhat-upgrades": "^3.0.3",
    "@typechain/hardhat": "^9.1.0",
    "@types/mocha": "^10.0.6",
    "chai": "^4.3.7",
    "dotenv": "^16.4.5",
    "ethers": "^6.11.1",
    "hardhat": "^2.20.1",
    "hardhat-deploy": "^0.11.45",
    "hardhat-gas-reporter": "^1.0.10",
    "mocha": "^10.3.0",
    "prettier": "3.1.1",
    "prettier-plugin-solidity": "^1.3.1",
    "solhint": "^4.1.1",
    "solidity-coverage": "^0.8.7",
    "ts-node": "^10.9.2"
  }

My issue is that during the tests, this code:

await hre.upgrades.admin.transferProxyAdminOwnership(
      tokenAddress,
      await newOwner.getAddress(),
      deployer,
      {}
    );

always logs: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 (transparent) proxy ownership transferred through proxy admin

This pollutes the tests output, and I cannot see of a convenient way of disabling it (maybe through environment variables? but I feel like it should be the opposite, enabled via env, like the rest of the plugin 's functionality). I figured that it might have something to do with my setup, but there is not much else to it.

Thanks for the feedback. I've opened PR https://github.com/OpenZeppelin/openzeppelin-upgrades/pull/978 to address this.

This is resolved in @openzeppelin/hardhat-upgrades@3.0.5.
You can set the silent option to true to silence the console logging completely when calling the transferProxyAdminOwnership function, for example:

await hre.upgrades.admin.transferProxyAdminOwnership(
      tokenAddress,
      await newOwner.getAddress(),
      deployer,
      { silent: true }
    );