lib/ofctl_utils: Log the datapath sent to
If a controller has multiple switches connected it is useful to be able to distinguish which datapath the msg is being sent to. Signed-off-by: Jason Kölker <jason@koelker.net> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
b0ab4f1602
commit
8b038a492e
|
@ -19,6 +19,7 @@ import logging
|
||||||
import netaddr
|
import netaddr
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from ryu.lib import dpid
|
||||||
from ryu.lib import hub
|
from ryu.lib import hub
|
||||||
|
|
||||||
|
|
||||||
|
@ -229,7 +230,12 @@ def send_msg(dp, msg, logger=None):
|
||||||
if msg.xid is None:
|
if msg.xid is None:
|
||||||
dp.set_xid(msg)
|
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)
|
dp.send_msg(msg)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue