[NTG-context] coloring the logfile

Henri Menke henrimenke at gmail.com
Thu Aug 29 09:39:49 CEST 2019



On 29/08/19 5:35 PM, Henning Hraban Ramm wrote:
> 
>> Am 2019-08-28 um 21:54 schrieb Hans van der Meer <havdmeer at ziggo.nl>:
>>
>> Is it possible to force lines  written in the log with \writestatus to have a specific color? The log can be very substantial and it would be nice to have some lines brought to attention by a different color.
> 
> As a text file, the log can’t have colors.
> 
> Only the output to your terminal could have ANSI color codes.
> I’d welcome this, too, but then we need additional configuration, color breaks easily on some shells, the feature should adhere to the usual shell variables etc. Don’t know it it would be worth the effort.

This will need engine support but is in principle dead easy.

#include <unistd.h>

if (isatty(fileno(stdout))) {
    // color
} else {
    // no color
}

> 
> Greetlings, Hraban
> ---
> https://www.fiee.net
> http://wiki.contextgarden.net
> https://www.dreiviertelhaus.de
> GPG Key ID 1C9B22FD
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 



More information about the ntg-context mailing list