Redirect everything coming from parrot sdk to log file


Is there a simple way to redirect everything coming from Parrot SDK in a log file?

I pdraw_element: 'AvcDecoder': element state change to STOPPED
I pdraw_element: 'VideoSink': element state change to STOPPING
I pdraw_element: 'VideoSink': element state change to STOPPED
I pdraw_element: 'VideoSink': element state change to STOPPING
I pdraw_element: 'VideoSink': element state change to STOPPED
I pdraw_dmxstrm: received RTCP goodbye, reason: user disconnection
I arsdkctrl: discovery 'net': remove device name='ANAFI-0000000' id='000000000000000000'
I arsdkctrl: internally disconnect device name='ANAFI-0000000' type=ANAFI4K id='000000000000000000'
I arsdkctrl: discovery 'net': stop
I rtsp_client: response to RTSP request TEARDOWN: status=200(OK) cseq=7 session=bb13e1401a608404 req_status=OK
I rtsp_client: client session bb13e1401a608404 removed
I rtsp_client: client disconnected

I saw in the Olympe documentation that we can specify a logfile at the Drone creation, but everything that is linked to pdraw seems to go through this.

In the Parrot SDK, it seems to be everything printed with the ULOGI function:

64:	ULOGI("signal %d(%s) received, stopping", signum, strsignal(signum));
75:	ULOGI("request options");
88:	ULOGI("request description");
99:		ULOGI("cancel request");
120:	ULOGI("request setup: url='%s' stream_port=%d control_port=%d",
151:	ULOGI("request play");
173:	ULOGI("request pause");
189:	ULOGI("request teardown");
208:	ULOGI("connection state: %s", rtsp_client_conn_state_str(state));
220:	ULOGI("session %s removed, status=%d(%s)",
250:	ULOGI("options_resp: methods allowed: 0x%08X", methods);
279:		ULOGI("describe_resp: %s, retry",
289:	ULOGI("describe_resp: sdp:\n%s", sdp);
344:	ULOGI("setup_resp: src_stream_port=%" PRIu16
352:		ULOGI("retry description after have failed");
388:	ULOGI("play_resp: scale=%.2f seq_valid=%d seq=%" PRIu16
396:	ULOGI("waiting for 5s...");
424:	ULOGI("pause_resp");
426:	ULOGI("waiting for 5s...");
457:	ULOGI("teardown_resp");
468:	ULOGI("announce: sdp:\n%s", sdp);

Do you know any workaround other than removing all this ULOGI from source files?

Thank you!


Logs produced by the Python side of Olympe use the logfile location provided in the Drone class constructor.

For logs produced with ULOG by C dependencies of Olympe (libpdraw, …), there is currently no simple way to redirect them elsewhere. They end up in Olympe stderr stream. This is a problem that has already been reported and we’re working on it.

In the meantime, you can always redirect stderr to anything but your console. If that is not option for you, then I guess that the quick and dirty way of disabling those logs would be to set the ULOG_LEVEL environment variable to an empty string i.e. : export ULOG_LEVEL=