Describe why color_gcc.py is no longer relevant

This commit is contained in:
Waf Project 2024-02-18 16:06:05 +01:00
parent 65b96e1ddd
commit f95b42651e
2 changed files with 6 additions and 4 deletions

View File

@ -2,6 +2,9 @@
# encoding: utf-8
# Replaces the default formatter by one which understands GCC output and colorizes it.
#
# This is mostly obsolete as gcc/g++ provide colored outputs by default:
# CFLAGS="-fdiagnostics-color=always" CXXFLAGS="-fdiagnostics-color=always" waf configure clean build
__author__ = __maintainer__ = "Jérôme Carretero <cJ-waf@zougloub.eu>"
__copyright__ = "Jérôme Carretero, 2012"
@ -36,4 +39,3 @@ class ColorGCCFormatter(Logs.formatter):
def options(opt):
Logs.log.handlers[0].setFormatter(ColorGCCFormatter(Logs.colors))

View File

@ -14,18 +14,18 @@ class ColorMSVCFormatter(Logs.formatter):
def __init__(self, colors):
self.colors = colors
Logs.formatter.__init__(self)
def parseMessage(self, line, color):
# Split messaage from 'disk:filepath: type: message'
arr = line.split(':', 3)
if len(arr) < 4:
return line
colored = self.colors.BOLD + arr[0] + ':' + arr[1] + ':' + self.colors.NORMAL
colored += color + arr[2] + ':' + self.colors.NORMAL
colored += arr[3]
return colored
def format(self, rec):
frame = sys._getframe()
while frame: