summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/lib/ofctl_utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ryu/lib/ofctl_utils.py b/ryu/lib/ofctl_utils.py
index a4097f87..89cd5c83 100644
--- a/ryu/lib/ofctl_utils.py
+++ b/ryu/lib/ofctl_utils.py
@@ -19,6 +19,7 @@ import logging
import netaddr
import six
+from ryu.lib import dpid
from ryu.lib import hub
@@ -229,7 +230,12 @@ def send_msg(dp, msg, logger=None):
if msg.xid is None:
dp.set_xid(msg)
- get_logger(logger).debug('Sending message with xid(%x): %s', msg.xid, msg)
+ log = get_logger(logger)
+ # NOTE(jkoelker) Prevent unnecessary string formating by including the
+ # format rules in the log_msg
+ log_msg = ('Sending message with xid(%x) to '
+ 'datapath(' + dpid._DPID_FMT + '): %s')
+ log.debug(log_msg, msg.xid, dp.id, msg)
dp.send_msg(msg)