From: Ben Pfaff Date: Tue, 14 Oct 2008 23:08:36 +0000 (-0700) Subject: dhcp-client: Log DHCP messages at higher priority. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1aa58028261f334b9c8a8e14b0088c502c2da89;p=openvswitch dhcp-client: Log DHCP messages at higher priority. Logging DHCP messages sent or received with priority DBG made it hard to see what was happening. So log them at priority WARN, but also make them less verbose at that level since seeing the whole message is not too useful most of the time. --- diff --git a/lib/dhcp-client.c b/lib/dhcp-client.c index 5e54017d..c770f2a6 100644 --- a/lib/dhcp-client.c +++ b/lib/dhcp-client.c @@ -943,8 +943,12 @@ do_receive_msg(struct dhclient *cli, struct dhcp_msg *msg) ofpbuf_pull(&b, (char *)b.l7 - (char*)b.data); error = dhcp_parse(msg, &b); if (!error) { - VLOG_DBG_RL(&rl, "received %s", - dhcp_msg_to_string(msg, false, &cli->s)); + if (VLOG_IS_DBG_ENABLED()) { + VLOG_DBG_RL(&rl, "received %s", + dhcp_msg_to_string(msg, false, &cli->s)); + } else { + VLOG_WARN_RL(&rl, "received %s", dhcp_type_name(msg->type)); + } ofpbuf_uninit(&b); return true; } @@ -1019,7 +1023,11 @@ do_send_msg(struct dhclient *cli, const struct dhcp_msg *msg) * frame to have to be discarded or fragmented if it travels over a regular * Ethernet at some point. 1500 bytes should be enough for anyone. */ if (b.size <= ETH_TOTAL_MAX) { - VLOG_DBG("sending %s", dhcp_msg_to_string(msg, false, &cli->s)); + if (VLOG_IS_DBG_ENABLED()) { + VLOG_DBG("sending %s", dhcp_msg_to_string(msg, false, &cli->s)); + } else { + VLOG_WARN("sending %s", dhcp_type_name(msg->type)); + } error = netdev_send(cli->netdev, &b); if (error) { VLOG_ERR("send failed on %s: %s",