Analyze command - Improvements in error handling and logging #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modest improvement in Error reporting and Archive handling
Explicitly check if a file is a Unity Archive rather than trying to mount every file just in case it turns out to be an archive.
Unity Archives have a distinctive signature string at the start so we can pre-triage which files are actually Unity Archives.
The expected values were confirmed by studying the Unity parsing code and debugging the load of some files in the editor.
Note: This is only a modest improvement because we still don't have some mechanism to predict if a file is a Unity Serialized File without attempting to load it and then failing. So when analyzing the output of a player build many files will still be reported as errors just because they are not actually containing built content.
Logging Improvements
Report number of successful, failed and ignored files at the end.
Previously it was hard to tell if errors were shown whether anything actually had been analyzed.
On error move console back to the start of the line, so that errors are not printed at a random indent.
Remove the noisy stack trace when there is an exception thrown during file processing.
Testing done
Running against AssetBundle and a Player build. This includes a very large directory of assetbundles from a customer that hits a lot of errors.
Also testing piping the output into a text file to make sure the logging is decent, e.g.