Colors in stderr log output

Bug #537700 reported by wouter bolsterlee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Anewt
Fix Released
Wishlist
wouter bolsterlee

Bug Description

It would be pretty nifty if the default log handler could detect that PHP is running on a TTY (i.e. in a terminal with the output not redirected), and include ANSI color escape sequences when outputting log messages.

It's not too hard to include the escape sequences, as can be shown in the way PHPUnit does it:
http://github.com/sebastianbergmann/phpunit/blob/3.5/PHPUnit/TextUI/ResultPrinter.php

Tags: logging
Revision history for this message
wouter bolsterlee (wbolster) wrote :

The posix_isatty() seems useful to detect an interactive terminal session.

Revision history for this message
wouter bolsterlee (wbolster) wrote :

 1771 Wouter Bolsterlee 2010-03-20
      [logging] Display colors in log output on stderr

      The default log handler now shows colorized log messages
      when running in an interactive terminal session.

      Fixes bug lp:537700.

Changed in anewt:
assignee: nobody → Wouter Bolsterlee (uws) (uws)
status: Triaged → Fix Released
Revision history for this message
wouter bolsterlee (wbolster) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.