added logging functionality to every file