Helper function to print the incoming msg on the console