Open garfvl opened 4 months ago
I did not forget about this one, but I knew I had another (big) one pending for which I should also dedicated some time. Now that https://github.com/oaubert/python-vlc/pull/275 is merged, I can merge this one, but it needs some porting to the new code - no real conflict, just moving things around I think. If you have some time to look at it, great. Else, I will do it some day.
This MR adds a way to link libVLC log system to a python logging.Logger object.
A new
set_logger
method is added to the Instance class to link a logging.Logger to the libvlc_log_set callback setup. The additional info from the log context (vlc module name, file, line, etc) are attached as extra info. The log context test is modified to check the set_logger behavior (as the context info is included in the logger).Tested on Linux and Windows, should work on macOS.