Update threatTrackSamples.py

Added logging, split into functions.