solidstate-network
hardhat-log-remover
TypeScript

Remove Hardhat console.log imports and calls from Solidity source files 🪓

Last updated Jun 7, 2026
15
Stars
4
Forks
2
Issues
0
Stars/day
Attention Score
53
Language breakdown
TypeScript 96.7%
Solidity 2.9%
Shell 0.4%
Files click to expand
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.0 were released as hardhat-log-remover, outside of the @solidstate namespace.
Versions of this plugin prior to 2.0.0 were released as buidler-log-remover.

Installation

npm install --save-dev @solidstate/hardhat-log-remover

or

pnpm add -D @solidstate/hardhat-log-remover

Usage

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-logs

or

pnpm hardhat remove-logs

Before removing logs, the plugin will ensure that all contracts can be compiled successfully.

Development

Install dependencies via pnpm:

pnpm install

Setup Husky to format code on commit:

pnpm prepare

© 2026 GitRepoTrend · solidstate-network/hardhat-log-remover · Updated daily from GitHub