add some code to print the log