How to log mavlink stream on GCS

Hi,

In my program on GCS, I have a stream of UDP datagram which I parse using the mavlink_parse_char() function and process it in the way necessary for me.
I need to log all the messages in the same format as the arducopter does.
Tell me please, how can I do this?
Am I understanding correctly that for this I should use the AP_Logger library in my program? What function member of the AP_Logger class should I use?

Thanks.

mavproxy does this for you already.

Really? Can you please explain?

  • start mavproxy
  • connect to the vehicle.
  • arm
  • takeoff.
  • land
  • close mavproxy.

the “mav.log” file gets created in the directory where you started mavproxy.

you’re talking about this project?: https://github.com/ArduPilot/MAVProxy