[gst-devel] [PATCH] turning off log coloring on non-terminals

Daniel Stodden dns at somacoma.de
Mon Oct 11 00:59:17 CEST 2004


hi.

while i'm fully committed to colored debug output: when piping to files
or processes most people (well, at least myself) tend to desire no
escape sequences automagically.

matches the behavior of all the common tools. e.g. compare 'ls
--color=auto' vs. 
'ls --color=auto |cat'.

ok?

[i'm aware of --gst-debug-no-color. i'd suggest an ls-style variant
--gst-debug-color[=WHEN] instead, where WHEN equals 'auto' per default.]

regards,
dns


Index: gst/gstinfo.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstinfo.c,v
retrieving revision 1.93
diff -u -r1.93 gstinfo.c
--- gst/gstinfo.c       3 Aug 2004 12:40:47 -0000       1.93
+++ gst/gstinfo.c       10 Oct 2004 22:31:46 -0000
@@ -493,7 +493,7 @@
   pid = getpid ();

   /* color info */
-  if (gst_debug_is_colored ()) {
+  if (gst_debug_is_colored () && isatty(STDERR_FILENO)) {
     color =
         gst_debug_construct_term_color (gst_debug_category_get_color
         (category));

-- 
Daniel Stodden
LRR   -   Lehrstuhl für Rechnertechnik und Rechnerorganisation
Institut für Informatik der TU Muenchen       D-85748 Garching
http://wwwbode.in.tum.de/~stodden     mailto:stodden at in.tum.de
                                                            --
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20041011/7e2ec95f/attachment.pgp>


More information about the gstreamer-devel mailing list