The default MSBuild logger does nice color-coding of output lines in the console window - if you happen to use the default black background for console windows. I find using black text on gray background in console windows to be easier on my eyes. (black on white is too bright.)
When running MSBUILD for our projects, the output comes out a now-hard-to-read cyan on gray for some lines. The yellow and red lines aren't as bad.
Is there a way to customize the colors used by the default MSBUILD logger? Perhaps tweaking some XML file in the VS2010 installed files? (We're using VS2010.)
I found the MSBUILD parameter "consoleloggerparameters" but it doesn't appear to offer such a feature.
Are there third-party custom loggers available that might allow such customization or is writing my own custom logger the only option? (We could, but time to do so is hard to come by.)
The colors are basically hardcoded. What you can do out of the box, with MSBuild 4.0, is completely disable colors using the
/clp:disableconsolecolor
option when invokingMSBuild.exe
(for more information on the/clp
option runMSBuild.exe /?
). With older MSBuild versions you can useMSBuild.exe arguments 2>&1| findstr /r ".*"
. See this answer for more details.If you want to have different colors, you need to implement your own (console) logger, which is not too hard, and use that (
/logger:
option, combined with/noconsolelogger
to turn off the default console logger).Using PowerShell, I suppose PS enthusiasts can provide a better script: