From 2a49d4a1aaf1d1fb644d3e4586989c696f657bcc Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 3 Apr 2017 15:09:30 +0200 Subject: Add --print-xmpp flag to log details --- xmpp-vala/src/core/stanza_attribute.vala | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xmpp-vala/src/core/stanza_attribute.vala') diff --git a/xmpp-vala/src/core/stanza_attribute.vala b/xmpp-vala/src/core/stanza_attribute.vala index 3169e90e..e6887f33 100644 --- a/xmpp-vala/src/core/stanza_attribute.vala +++ b/xmpp-vala/src/core/stanza_attribute.vala @@ -17,6 +17,14 @@ public class StanzaAttribute : StanzaEntry { } } + public string to_ansi_string(bool hide_ns = false) { + if (ns_uri == null || hide_ns) { + return @"$name=$ANSI_COLOR_GREEN'$val'$ANSI_COLOR_END"; + } else { + return @"$ANSI_COLOR_GRAY{$ns_uri}:$ANSI_COLOR_END$name=$ANSI_COLOR_GREEN'$val'$ANSI_COLOR_END"; + } + } + public string to_xml(NamespaceState? state_) throws XmlError { NamespaceState state = state_ ?? new NamespaceState(); if (ns_uri == state.current_ns_uri || (ns_uri == XMLNS_URI && name == "xmlns")) { -- cgit v1.2.3-54-g00ecf