summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-07 01:21:01 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-07 01:23:52 +0200
commit394b54992600342dddb86a39952771155739669f (patch)
tree4692d9d8db360d272b236ca47da02456d2953494
parent8282b7bd4560949a2f8152dff621429248305683 (diff)
downloadxK-394b54992600342dddb86a39952771155739669f.tar.gz
xK-394b54992600342dddb86a39952771155739669f.tar.xz
xK-394b54992600342dddb86a39952771155739669f.zip
degesch: print server name in debug output
-rw-r--r--degesch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index 5f3a656..eaa772c 100644
--- a/degesch.c
+++ b/degesch.c
@@ -3054,9 +3054,12 @@ irc_send (struct server *s, const char *format, ...)
{
input_hide (&s->ctx->input);
+ char *server_name =
+ iconv_xstrdup (s->ctx->term_from_utf8, s->name, -1, NULL);
char *term = irc_to_term (s->ctx, str.str);
- fprintf (stderr, "[IRC] <== \"%s\"\n", term);
+ fprintf (stderr, "[%s] <== \"%s\"\n", server_name, term);
free (term);
+ free (server_name);
input_show (&s->ctx->input);
}
@@ -5152,9 +5155,12 @@ irc_process_message (const struct irc_message *msg,
{
input_hide (&s->ctx->input);
+ char *server_name =
+ iconv_xstrdup (s->ctx->term_from_utf8, s->name, -1, NULL);
char *term = irc_to_term (s->ctx, raw);
- fprintf (stderr, "[IRC] ==> \"%s\"\n", term);
+ fprintf (stderr, "[%s] ==> \"%s\"\n", server_name, term);
free (term);
+ free (server_name);
input_show (&s->ctx->input);
}