This is a reusable scripted logging and status control