Add colorized logging
Review Request #8614 — Created Jan. 12, 2017 and submitted
rbtnow supports colorized logging when writing to a TTY (otherwise,
uncolored logging will be used). The colors can be specified in
.reviewboardrcin theCOLORSvariable, which maps logging levels
to colors (as plain text names) orNone. An invalid color name will
be mapped to no color.As part of this, the config parsing for nested (dict) variables has
been updated to be more generic and provide defaults where
appropriate.
- Ran
rbtto pipe and to a file: colored logging was not observed. - Ran
rbtto a terminal: logging was colored appropriately.
| Description | From | Last Updated |
|---|---|---|
|
This is kind of hard to follow. Can we not reuse the "color" variable quite so much? |
|
|
|
Could avoid some conditionals and repetition if these were just the defaults set at the top of the method. |
|
|
|
This could be nested within the if color_name conditional. |
|
|
|
This is no longer necessary. |
|
|
|
isn't here a color_name.upper? |
AL AlexTalker |
-
Tool: Pyflakes Processed Files: setup.py rbtools/utils/filesystem.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: setup.py rbtools/utils/filesystem.py rbtools/commands/__init__.py
Tool: Pyflakes Processed Files: setup.py rbtools/utils/filesystem.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: setup.py rbtools/utils/filesystem.py rbtools/commands/__init__.py