diff options
author | hrxi <hrrrxi@gmail.com> | 2019-05-31 23:25:07 +0200 |
---|---|---|
committer | fiaxh <fiaxh@users.noreply.github.com> | 2019-06-06 15:32:11 +0200 |
commit | 7097a7185261f2ae4e9555744c4c75703238c699 (patch) | |
tree | e6d729fc4135a6c2214d99521c77592e4e990ed2 /xmpp-vala/src/core | |
parent | 8120203d62f52315f04364e70b3ac6beefe043de (diff) | |
download | dino-7097a7185261f2ae4e9555744c4c75703238c699.tar.gz dino-7097a7185261f2ae4e9555744c4c75703238c699.zip |
Fix ANSI color removal for XMPP log on non-tty stderrs
Diffstat (limited to 'xmpp-vala/src/core')
-rw-r--r-- | xmpp-vala/src/core/xmpp_log.vala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xmpp-vala/src/core/xmpp_log.vala b/xmpp-vala/src/core/xmpp_log.vala index b42cd30a..921899c4 100644 --- a/xmpp-vala/src/core/xmpp_log.vala +++ b/xmpp-vala/src/core/xmpp_log.vala @@ -110,13 +110,13 @@ public class XmppLog { public void node(string what, StanzaNode node) { if (should_log_node(node)) { - stderr.printf("%sXMPP %s [%s]%s\n%s\n", ANSI_COLOR_WHITE, what, ident, ANSI_COLOR_END, use_ansi ? node.to_ansi_string(hide_ns) : node.to_string()); + stderr.printf("%sXMPP %s [%s]%s\n%s\n", use_ansi ? ANSI_COLOR_WHITE : "", what, ident, use_ansi ? ANSI_COLOR_END : "", use_ansi ? node.to_ansi_string(hide_ns) : node.to_string()); } } public void str(string what, string str) { if (should_log_str(str)) { - stderr.printf("%sXMPP %s [%s]%s\n%s\n", ANSI_COLOR_WHITE, what, ident, ANSI_COLOR_END, str); + stderr.printf("%sXMPP %s [%s]%s\n%s\n", use_ansi ? ANSI_COLOR_WHITE : "", what, ident, use_ansi ? ANSI_COLOR_END : "", str); } } |