Added method for writing data to debug.log.