adds logging to script