about summary refs log tree commit diff
path: root/src/libutil/logging.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-03-15T15·08+0100
committerEelco Dolstra <edolstra@gmail.com>2018-03-15T15·08+0100
commit486872150638d56483c2bc429ba9e137d9974ee8 (patch)
tree469f6346618c2fbe1eb2e4282ef7e6cc90c01ff5 /src/libutil/logging.cc
parent7b8914825a6b02173976eae0ca59053085d4b20a (diff)
Filter ANSI colors when not writing to a terminal
Fixes https://github.com/NixOS/nixpkgs/issues/37114.
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r--src/libutil/logging.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index e860b27d3d0b..799c6e1ae441 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -53,7 +53,7 @@ public:
             prefix = std::string("<") + c + ">";
         }
 
-        writeToStderr(prefix + filterANSIEscapes(fs.s) + "\n");
+        writeToStderr(prefix + filterANSIEscapes(fs.s, !tty) + "\n");
     }
 
     void startActivity(ActivityId act, Verbosity lvl, ActivityType type,