summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-04-16 11:22:47 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-04-18 08:57:32 +0200
commitfa79ac662465b80900646ffc8998ed3f72ef49d2 (patch)
tree852ab54c18779301745054e729ed4255a834d6d2
parent08585dc696b299d414eaa00ded85829f9c2ec2e9 (diff)
debug-message: strip the message from trailing whitespaces
empathy-debug-window was doing that; it doesn't hurt and will save Empathy from copying the string to strip it itself.
-rw-r--r--telepathy-glib/debug-message.c3
-rw-r--r--tests/dbus/debug-client.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/telepathy-glib/debug-message.c b/telepathy-glib/debug-message.c
index 463df392e..8f7943a2a 100644
--- a/telepathy-glib/debug-message.c
+++ b/telepathy-glib/debug-message.c
@@ -164,7 +164,7 @@ tp_debug_message_class_init (
/**
* TpDebugMessage:message:
*
- * Text of the debug message
+ * Text of the debug message, stripped from its trailing whitespaces.
*
* Since: UNRELEASED
*/
@@ -226,6 +226,7 @@ _tp_debug_message_new (gdouble timestamp,
self->priv->domain = g_strdup (domain);
self->priv->level = debug_level_to_log_level_flags (level);
self->priv->message = g_strdup (message);
+ g_strchomp (self->priv->message);
return self;
}
diff --git a/tests/dbus/debug-client.c b/tests/dbus/debug-client.c
index db02bf80e..6c73bfdf8 100644
--- a/tests/dbus/debug-client.c
+++ b/tests/dbus/debug-client.c
@@ -207,7 +207,7 @@ test_get_messages (Test *test,
g_date_time_to_timeval (time1, &time_val);
tp_debug_sender_add_message (test->sender, &time_val, "domain1",
- G_LOG_LEVEL_MESSAGE, "message1");
+ G_LOG_LEVEL_MESSAGE, "message1\n");
time2 = g_date_time_new_now_local ();
g_date_time_to_timeval (time2, &time_val);