Register a callback function for the EnterProximity event. Within the callback function you can record the sensor and simulation time to a file:
Code:
def EnterProximity(e):
"""@args vizproximity.ProximityEvent()"""
sensor = e.sensor
time = viz.getFrameTime()
#record sensor and time to file
manager.onEnter(None,EnterProximity)