cgewecke / hardhat-gas-reporter

Gas Usage Analytics for Hardhat
MIT License
411 stars 57 forks source link

Output to a readable file? #91

Closed liron-navon closed 6 months ago

liron-navon commented 2 years ago

can we make an output to MD/HTML? anything that is a bit more human readable? it is seen nicely in the console, but is not readable once it's a file, also maybe JSON/XML? to make it machine-readable more easily?

cgewecke commented 2 years ago

Hi @liron-navon

it is seen nicely in the console, but is not readable once it's a file,

Are you seeing the table mangled with extra characters? If so you can prevent that by setting the noColors option to true.

Alternative formats is a great idea and there is some prior work in this direction:

Lastly, the gas reporter writes all the data it collects to a JSON file at ./gasReporterOutput.json whenever the environment variable CI is set to true. This might be useful for experimenting with alternative table formats.

cgewecke commented 6 months ago

Markdown was added in the latest version (2.0). If someone is interested in adding HTML am happy to accept a pull request - there's architecture in place for arbitrary output formats in the codebase now.

Closing for now.

https://github.com/cgewecke/hardhat-gas-reporter/releases/tag/v2.0.0