[idea] ECHO rule output in colours

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[idea] ECHO rule output in colours

Mateusz Loskot
Hi,

I've been dreaming [1] about implementing colourful output from
Boost.Built for a while now.

[1] https://svn.boost.org/trac/boost/ticket/3508

I know close to nothing about internals of Boost.Built.
Simply, I have scanned and read through tools/build/v2/*.jam files and
C source code in tools/build/v2/engine
and came up with the following idea:

Colour is specified by name given as optional argument to ECHO rule:

ECHO "hello world" : green ;

ECHO supports limited number of popular colours: red, green, blue, yellow,
and may be cyan and magenta too.

ECHO could also support extra argument specifying font weight, two
values only: bold or normal

Next, builtin_echo() determines if any of formatting arguments have
been specified
and passes relevant arguments to printing like list_print.
It means, list_print and other printing functions need to be modified.

So, the colouring machinery is implemented in C in the
tools/build/v2/engine only
and it should support Unix consoles and Windows.

Once colouring for ECHO rule is available, I'm thinking about updating .jam
parts to format output where it makes sense.
For example:
- Compiler and linker errors in red (bold)
- Compiler and linker warnings in yellow (bold)
- In test module: **passed** in green and **failed** in red (bold)
- Boost.Build errors in cyan (normal)
- Boost.Build progress indicated with colours, e.g. final command on
target in green
etc.

IMHO, colours if used properly could extremely improve readability of
BBv2 output.

Is this a good idea?
Am I tackling it from the right angle or there is a better approach?
I'd appreciate any comments.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
--
Mateusz Loskot, http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: [idea] ECHO rule output in colours

paulo.alves
It would be awesome such thing; some times it's not so easy to find
the error, or see a warning.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: [idea] ECHO rule output in colours

Boost - Build mailing list
In reply to this post by Mateusz Loskot
Mateusz Loskot wrote

> I know close to nothing about internals of Boost.Built.
> Simply, I have scanned and read through tools/build/v2/*.jam files and
> C source code in tools/build/v2/engine
> and came up with the following idea:
>
> Colour is specified by name given as optional argument to ECHO rule:
>
> ECHO "hello world" : green ;
> ...
> Is this a good idea?

FYI, I've submitted experiment with working proposal for this
https://github.com/boostorg/build/pull/573





-----
--
Mateusz Loskot, http://mateusz.loskot.net
--
Sent from: http://boost.2283326.n4.nabble.com/Boost-Build-f2685023.html
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build