Redirecting Olympe console output


I am running Olympe as Python module in Jupyter. However, if I want to debug is uncomfortable due to the limited width of the notebook, thus the output turns out as unformatted (lines are wrapped and it becomes clumsy to read).

Is there any way to redirect the output? I tried setting sys.stdout to a file but it didnt work.

Thanks in advance!



By default Olympe logs go to the console stdout. To change Olympe log location you must provide a “logfile” parameter to the olympe.Drone constructor.

This parameter defaults to sys.stdout but you can pass any File-object-like object. For example :

drone = olympe.Drone("", logfile=open("/tmp/olympe.log", "a+"))