facebookarchive / prepack

A JavaScript bundle optimizer.
http://prepack.io
Other
14.22k stars 425 forks source link

Produce log file with additional (internal) diagnostics #2567

Open NTillmann opened 5 years ago

NTillmann commented 5 years ago

The diagnostics message in #2566 was really not meant for an end-user, but for Prepack developers only. Similarly, to diagnose issues like in #2564, some extra internal information, here the IR dump, is crucial.

Prepack should have a general mechanism to produce a central log file, maybe via --log, plus the ability to configure the verbosity of logging, maybe via --logVerbosity.

The log file would receive the usual stream of diagnostics message, but also additional, typically rather internal diagnostics messages, including an IR dump at an extreme verbosity setting.

Generally, this should consolidate/replace the current random console.log(...) logging in various places for various reasons under various conditions.

We should carefully design the infrastructure to feed into this log.