kytos-ng / of_core

Kytos Main OpenFlow Network Application (NApp)
MIT License
0 stars 5 forks source link

Improve log message for PortStatus events #97

Closed italovalcy closed 1 year ago

italovalcy commented 1 year ago

Fixes #7

Description of the change

This PR improves the logging message sent upon receiving a PortStatus OF message to help the network operator understand the network's state from the log messages (very useful for troubleshooting activities).

Before this PR, the only message that was being recorded at the logs were Modified {interface} {dpid}:{port_number}: no info about the new state and no info when other states were being recorded.

Local tests

Running Kytos with this PR and simulating a link failure and recovery gives the following log messages:

Jan 12 17:57:41 4919fb6963ef kytos.napps.kytos/of_core:INFO main:652:  PortStatus modified interface 00:00:00:00:00:00:00:12:1 state 0
Jan 12 17:57:41 4919fb6963ef kytos.napps.kytos/of_core:INFO main:652:  PortStatus modified interface 00:00:00:00:00:00:00:12:1 state OFPPS_LINK_DOWN
Jan 12 17:57:41 4919fb6963ef kytos.napps.kytos/of_core:INFO main:652:  PortStatus modified interface 00:00:00:00:00:00:00:11:1 state 0
Jan 12 17:57:41 4919fb6963ef kytos.napps.kytos/of_core:INFO main:652:  PortStatus modified interface 00:00:00:00:00:00:00:11:1 state OFPPS_LINK_DOWN
Jan 12 17:57:51 4919fb6963ef kytos.napps.kytos/of_core:INFO main:652:  PortStatus modified interface 00:00:00:00:00:00:00:12:1 state OFPPS_LIVE
Jan 12 17:57:51 4919fb6963ef kytos.napps.kytos/of_core:INFO main:652:  PortStatus modified interface 00:00:00:00:00:00:00:11:1 state OFPPS_LIVE
gretelliz commented 1 year ago

This PR seems very good to me.