https://github.com/solidstate-network/hardhat-log-remover
Remove Hardhat console.log imports and calls from Solidity source files 🪓
https://github.com/solidstate-network/hardhat-log-remover
blockchain buidler console console-log ethereum hardhat log smart-contracts solidity wow
Last synced: 5 months ago
JSON representation
Remove Hardhat console.log imports and calls from Solidity source files 🪓
- Host: GitHub
- URL: https://github.com/solidstate-network/hardhat-log-remover
- Owner: solidstate-network
- License: mit
- Created: 2020-09-12T03:11:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-09-18T18:10:09.000Z (6 months ago)
- Last Synced: 2025-10-03T07:14:26.679Z (6 months ago)
- Topics: blockchain, buidler, console, console-log, ethereum, hardhat, log, smart-contracts, solidity, wow
- Language: TypeScript
- Homepage:
- Size: 503 KB
- Stars: 13
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
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](https://github.com/wighawag/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
```bash
npm install --save-dev @solidstate/hardhat-log-remover
# or
pnpm add -D @solidstate/hardhat-log-remover
```
## Usage
Load plugin in Hardhat config:
```javascript
import hardhatLogRemover from '@solidstate/hardhat-log-remover';
const config: HardhatUserConfig = {
plugins: [
hardhatLogRemover,
],
};
```
Run the Hardhat task manually:
```bash
npx hardhat remove-logs
```
# or
```bash
pnpm hardhat remove-logs
```
Before removing logs, the plugin will ensure that all contracts can be compiled successfully.
## Development
Install dependencies via pnpm:
```bash
pnpm install
```
Setup Husky to format code on commit:
```bash
pnpm prepare
```