The previous logging infrastructure had several problems:
- Debugging output was emitted to standard output which is also where the symbolized output would go. Interleaving these two separate bits of information makes inspecting the output difficult and could potentially break tests.
- Enabling debugging output requires modifying the script which is not very conveninent.
- When debugging it isn't immediately obvious where the output is coming from.
This patch uses the Python standard library logging infrastructure
which fixes all of the above problems. Logging is controlled using
two new options.
- --log-level - Sets the logging level, default is
info.
- --log-dest - Set the logging destination, default
is standard error.
Some simple test cases for the feature are included.
rdar://problem/49476995
I'd prefer we avoid env variables here
I guess you can use
to parse args before pluggins just to setup logging
and then parse them again with additional flags.