code-base-investigator icon indicating copy to clipboard operation
code-base-investigator copied to clipboard

Add a custom log formatter class

Open Pennycook opened this issue 1 year ago • 0 comments

Makes the following two changes to the log format:

  • Use lower-case prefixes to mimic compiler behavior.
  • Use ASCII color codes when available.

Related issues

Closes #25.

Proposed changes

  • Add a new Formatter class that applies the desired formatting to our logs.
  • Disable colors when writing to file, because ASCII codes don't work there.
  • Disable colors when stdout is redirected to a file.

We might want to revisit this much later on if we want to be really fancy (i.e., if we want to do things like allow warning messages to highlight different parts of their own messages, etc) but the difference from just providing a little bit of color is pretty striking:

image

Pennycook avatar Sep 26 '24 13:09 Pennycook