added logging functionality, and improved pre commit checker