[Scons-users] coloring compoiler / linker output

Nick Hilton weegreenblobbie at yahoo.com
Sun Aug 31 15:22:49 EDT 2014


Hi,

The only workable technique that I know of is replacing env['SPAWN'] with your own wrapper that spawns the command in subprocess and you capture stdout & stderr through pipes.  Then you can process the output and write the special terminal codes to get colored output.

To see an example of a env['SPAWN'] replacement look at the file 'builder_support.py' on this scons issue:

http://scons.tigris.org/issues/show_bug.cgi?id=2974

It filters out the extra output from visual studio's cl.exe compiler.  But using env['SPAWN'] will break the build if the command line gets too long.

I've used colorama successfully in the project at work, until the command line gets too long.  Issue 2974 is to fix the problem and perhaps provide us an easier way to customize the builder output.

:)
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140831/0c374db3/attachment-0001.html>


More information about the Scons-users mailing list