httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <>
Subject Re: colors subs in Apache::TestTrace
Date Fri, 14 Dec 2001 08:48:01 GMT
On Fri, 14 Dec 2001, Stas Bekman wrote:

> In Apache::SmokeTest I use warning/error subs from TestTrace to make the 
> generated output easy to read and distinguish important prints from less 
> important. But of course error and warning aren't the right names to 
> use. What's the best thing to do in this case? I was thinking about 
> adding a set of other subs to TestTrace derived from the used 
> highlighting color. e.g. red/yellow (basically a wrapper for 
> Term::ANSIColor, which also can do different things with 
> APACHE_TEST_NO_COLOR. What do you think. Look at SmokeTest to see what I 
> mean.

i'd like colors to stay the same for the levels.. but agree that the color
helps to distinguish the output.  i think the right thing to do would be
to raise the default level to 'info' and start to use 'notice' and
'info' for the verbose outputs.  if somebody wants less verbose, they can
turn the level down.

> Also the thread about APACHE_TEST_NO_COLOR didn't come to conclusion, 
> should we replace the env var with --batch option (or add it as an 
> alternative)?

oh yeah, i forgot to mention, no need for a new option.  there is the -t
file test operator:
    -t	Filehandle is opened to a tty.

so if -t STDOUT is true, enable colors, startup counter, etc., else turn
them off.  it will be false for cron jobs or anything that redirects
stdout, like t/TEST -v > test.log

that can be implemented with a env var or global, doesn't matter to me
which.  an env var can always be used to set the global, overridding the
-t test.

View raw message