From c18771a96ddb5b06bba5561aa30bcff917964b6f Mon Sep 17 00:00:00 2001 From: thorkill Date: Thu, 9 Jul 2015 23:49:52 +0200 Subject: [PATCH] Make informative logs about edge changes --- src/protocol_edge.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/protocol_edge.c b/src/protocol_edge.c index 08eabb18..901104c9 100644 --- a/src/protocol_edge.c +++ b/src/protocol_edge.c @@ -143,15 +143,13 @@ bool add_edge_h(connection_t *c, const char *request) { sockaddrfree(&local_address); return true; } else { - logger(DEBUG_PROTOCOL, LOG_WARNING, "Got %s from %s (%s) which does not match existing entry", - "ADD_EDGE", c->name, c->hostname); /* Update weight first */ if(e->weight != weight){ - logger(DEBUG_PROTOCOL, LOG_WARNING, "Got %s from %s (%s) with new weight %d -> %d", - "ADD_EDGE", c->name, c->hostname, e->weight, weight); - //edge_update_weigth(e, weight); - //if (e->reverse) - // edge_update_weigth(e->reverse, weight); + logger(DEBUG_PROTOCOL, LOG_WARNING, "Got %s from %s (%s) with new weight %s -> %s %d -> %d", + "ADD_EDGE", c->name, c->hostname, e->from->name, e->to->name, e->weight, weight); + } else { + logger(DEBUG_PROTOCOL, LOG_WARNING, "Got %s from %s (%s) which does not match existing entry", + "ADD_EDGE", c->name, c->hostname); } edge_del(e); graph();