Implemented a function to write a debug log