From a1aa58028261f334b9c8a8e14b0088c502c2da89 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 14 Oct 2008 16:08:36 -0700 Subject: [PATCH] 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. --- lib/dhcp-client.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/dhcp-client.c b/lib/dhcp-client.c index 5e54017df..c770f2a60 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", -- 2.43.0