ethereum / solidity-examples

Loose collection of Solidity example code
MIT License
534 stars 161 forks source link

Add logging #39

Closed androlo closed 7 years ago

androlo commented 7 years ago

Next push will contain a "logs" directory. One thing it will contain is a sub-folder for perf logs that are made from ethvm dumps. The logs are formatted as JSON, and can among other things be diff'ed with previous logs using the newly added jsondiffpatch tool.

Test logs will eventually be added as well, although they will probably be saved as-is.

Note that these logs doesn't come with the repo, but has to be generated - which is done automatically when running the test/perf suites. There might be logs available later in the CI box.

androlo commented 7 years ago

The perf log objects are added in logs/perf/<timestamp> where <timestamp> is the unix timestamp at the time of creation. The folder contains a results_optimized.json, and optionally also a results_unoptimized.json (if the perf was done for unoptimized as well).

A results file currently contains the compiler and evm versions, as well as the result for every perf test, which consists of gas cost, number of instructions, max expansion of memory, and a list of expensive instructions and how many times they were used (more detailed info will be added to the perf documentation).

There is a latest file in the logs/perf directory, which points to the latest, although it is mostly for convenience since the latest log will always be the one with the highest timestamp.

When running perf, comparison is done between new and old objects (if such a comparison is possible), and if there is a difference that is formatted and written to the terminal. Printing the entire log is too much, but there should be a way to view logs (and also diffs) through the command-line tool.

androlo commented 7 years ago

tests should also be logged.

androlo commented 7 years ago

done