Writing a test logging function