Skip to content

Commit 034b5e4

Browse files
authored
Merge pull request #933 from douglasjacobsen/debug-logging-perf
Guard debug logging for performance
2 parents 5292ca8 + 2df616c commit 034b5e4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ramble/ramble/util/logger.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,10 @@ def debug(self, *args, **kwargs):
192192
Pass all args and kwargs to tty.debug (which will concatenate and
193193
print). Perform this action for the active log only.
194194
"""
195-
st_kwargs = self._stream_kwargs(default_kwargs=kwargs)
196-
with self.configure_colors(**st_kwargs):
197-
tty.debug(*args, **st_kwargs)
195+
if tty._debug:
196+
st_kwargs = self._stream_kwargs(default_kwargs=kwargs)
197+
with self.configure_colors(**st_kwargs):
198+
tty.debug(*args, **st_kwargs)
198199

199200
def error(self, *args, **kwargs):
200201
"""Print an error message

0 commit comments

Comments
 (0)