Running Hardhat with debug logs
If you are having a problem with Hardhat, you can run it with debug logs enabled.
For example, this runs the build process with debug logs:
DEBUG='hardhat*' npx hardhat buildDEBUG='hardhat*' pnpm hardhat buildDEBUG='hardhat*' yarn hardhat buildFiltering logs
Section titled “Filtering logs”You can filter which logs to display by adding a longer prefix to the DEBUG env variable.
For example, this runs the build process only with logs coming from Hardhat’s Solidity integration:
DEBUG='hardhat:core:solidity:*' npx hardhat buildDEBUG='hardhat:core:solidity:*' pnpm hardhat buildDEBUG='hardhat:core:solidity:*' yarn hardhat buildSharing debug logs and privacy
Section titled “Sharing debug logs and privacy”The debug logs printed by Hardhat can include information that you may consider somewhat private.
These can include the following, and potentially more private pieces of data:
- Your operating system user name
- The absolute path to your Hardhat project
- Your telemetry ID (this is a random number, but posting it online associates it to your identity)
- The name of your contracts, if you consider those private
- Potentially an RPC URL (we anonymize them whenever possible though)
Please review what you are posting online before doing so, and redact whatever you want to keep private.