Record events scheduled in CHOTestMonkey and enable replay from
recorded event file

Change-Id: If73eb743e19565ff8a91ac0b54eb18d8706be831
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
index 07c8cb6..4283ff6 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
@@ -63,7 +63,7 @@
 
     def startEvent( self, args ):
         with self.eventLock:
-            main.log.info( "%s - starting event" % ( self.typeString ) )
+            #main.log.info( "%s - starting event" % ( self.typeString ) )
             if self.typeIndex == EventType().APP_INTENT_HOST_ADD or self.typeIndex == EventType().APP_INTENT_HOST_DEL:
                 if len( args ) < 3:
                     main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
@@ -138,6 +138,7 @@
                 intent.hostB == self.hostA and intent.hostA == self.hostB:
                     main.log.warn( self.typeString + " - find an exiting intent for the host pair, abort installation" )
                     return EventStates().ABORT
+            main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.hostA.name, self.hostB.name, self.CLIIndex ) )
             controller = main.controllers[ self.CLIIndex - 1 ]
             with controller.CLILock:
                 id = controller.CLI.addHostIntent( self.hostA.id, self.hostB.id )
@@ -179,6 +180,7 @@
             if targetIntent == None:
                 main.log.warn( self.typeString + " - intent does not exist" )
                 return EventStates().FAIL
+            main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.hostA.name, self.hostB.name, self.CLIIndex ) )
             controller = main.controllers[ self.CLIIndex - 1 ]
             with controller.CLILock:
                 result = controller.CLI.removeIntent( targetIntent.id, purge=True )
@@ -204,7 +206,7 @@
 
     def startEvent( self, args ):
         with self.eventLock:
-            main.log.info( "%s - starting event" % ( self.typeString ) )
+            #main.log.info( "%s - starting event" % ( self.typeString ) )
             if self.typeIndex == EventType().APP_INTENT_POINT_ADD or self.typeIndex == EventType().APP_INTENT_POINT_DEL:
                 if len( args ) < 3:
                     main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
@@ -290,6 +292,7 @@
                 if intent.deviceA == self.deviceA and intent.deviceB == self.deviceB:
                     main.log.warn( self.typeString + " - find an exiting intent for the device pair, abort installation" )
                     return EventStates().ABORT
+            main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.deviceA.name, self.deviceB.name, self.CLIIndex ) )
             controller = main.controllers[ self.CLIIndex - 1 ]
             with controller.CLILock:
                 srcMAC = ""
@@ -336,6 +339,7 @@
             if targetIntent == None:
                 main.log.warn( self.typeString + " - intent does not exist" )
                 return EventStates().FAIL
+            main.log.info( "Event recorded: {} {} {} {} {}".format( self.typeIndex, self.typeString, self.deviceA.name, self.deviceB.name, self.CLIIndex ) )
             controller = main.controllers[ self.CLIIndex - 1 ]
             with controller.CLILock:
                 result = controller.CLI.removeIntent( targetIntent.id, purge=True )