Open
Conversation
Citing from Python 3.12 release: "A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning (...) In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning." https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes
oaubert
requested changes
May 16, 2024
Owner
oaubert
left a comment
There was a problem hiding this comment.
Looks great. Please see if you can address the comments.
Add a way to load the local standard C library. This could be used to load some C standard functions, like *printf ones. This should work on Linux, Windows and macOS/Darwin environments.
Adds a way to link libVLC log system to a python logging.Logger object. The logger and log callback is attached to the libVLC Instance object to avoid the python garbage collector to destroy them too soon. NOTE: as libVLC log messages are based on a printf + va_list format, we need to use the standard C `vsnprintf` function with a max fixed size output.
Adds a functional test for the Instance.set_logger method. This will also test the log_get_context, as this is part of the logger output.
This can be useful if some logger is set and you want to get access to it afterwards.
Owner
|
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 #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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This MR adds a way to link libVLC log system to a python logging.Logger object.
A new
set_loggermethod 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.