How to log MAVLINK messages on Autopilot


I am using mavlink c library to create an application that sends ATT_POS_MOCAP messages to the Autopilot. It would be useful to have a way to test if the Autopilot receives the messages. I tried googling but I got confused on how can I log Mavlink messages received by the Autopilot. Is there any way to do it eventually?

I also thought about using Wireshark to see if the messages are sent correctly by my app (hoping that they arrive as well).

Any recommendations?