From 05212d309275778ebf42674edbba8c19aed49192 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Sat, 31 May 2025 16:21:06 -0700 Subject: [PATCH] Don't write color escape characters to file --- pysnooper/tracer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysnooper/tracer.py b/pysnooper/tracer.py index 206866c..59509f2 100644 --- a/pysnooper/tracer.py +++ b/pysnooper/tracer.py @@ -264,7 +264,7 @@ class Tracer: self.max_variable_length = max_variable_length self.normalize = normalize self.relative_time = relative_time - self.color = color + self.color = color and (output is None) if self.color: self._FOREGROUND_BLUE = '\x1b[34m'