Adding log function for outputting messages to the console.