@solidstate/hardhat-log-remover
v3.0.1
Published
Remove Hardhat console.log imports and calls from Solidity source files
Maintainers
Readme
Hardhat Log Remover
Remove Hardhat console.log imports and calls from Solidity source code.
This plugin is intended in part to keep version-controlled code free of log statements. To remove logs from compiled contracts while preserving them in source code, see hardhat-preprocessor.
Versions of this plugin prior to
3.0.0were released ashardhat-log-remover, outside of the@solidstatenamespace.
Versions of this plugin prior to
2.0.0were released asbuidler-log-remover.
Installation
npm install --save-dev @solidstate/hardhat-log-remover
# or
pnpm add -D @solidstate/hardhat-log-removerUsage
Load plugin in Hardhat config:
import hardhatLogRemover from '@solidstate/hardhat-log-remover';
const config: HardhatUserConfig = {
plugins: [
hardhatLogRemover,
],
};Run the Hardhat task manually:
npx hardhat remove-logsor
pnpm hardhat remove-logsBefore removing logs, the plugin will ensure that all contracts can be compiled successfully.
Development
Install dependencies via pnpm:
pnpm installSetup Husky to format code on commit:
pnpm prepare