[PATCH] D60343: [asan_symbolize] Use proper logging infrastructure.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 15:43:29 PDT 2019


delcypher created this revision.
delcypher added reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka.
Herald added projects: LLVM, Sanitizers.
Herald added a subscriber: Sanitizers.

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 environment variables.

- `ASAN_SYMBOLIZER_LOG_LEVEL` - Sets the logging level, default is

`info`.

- `ASAN_SYMBOLIZER_LOG_DEST` - Set the logging destination, default

is standard error.

The choice to set logging configuration using environment variables
rather than with command line arguments is deliberate. In future patches
I intend to add a simple plug-in infrastructure. These plug-ins need to
be loaded before argument parsing (so they can add their own command
line arguments if needed) so the logging infrastructure needs to be set
up before this.

rdar://problem/49476995


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D60343

Files:
  lib/asan/scripts/asan_symbolize.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60343.193979.patch
Type: text/x-patch
Size: 5014 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190405/94732294/attachment-0001.bin>


More information about the llvm-commits mailing list