diff --git a/waflib/extras/color_gcc.py b/waflib/extras/color_gcc.py index 09729035..b580396c 100644 --- a/waflib/extras/color_gcc.py +++ b/waflib/extras/color_gcc.py @@ -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 " __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)) - diff --git a/waflib/extras/color_msvc.py b/waflib/extras/color_msvc.py index 60bacb7b..3ea9ee63 100644 --- a/waflib/extras/color_msvc.py +++ b/waflib/extras/color_msvc.py @@ -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: