-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow frontends/GUIs to write log messages #14551
Comments
What do you mean by frontend? You can use |
With frontend, I mean a mpv GUI like mpv.net, which uses the client API. |
So, use |
I cannot find https://github.com/mpv-player/mpv/blob/master/libmpv/client.h |
Good catch. I also assumed there's a libmpv api for logging, but seems there isn't. |
Oh, my bad. Our public api is prefixed with |
libmpv clients are expected to be responsible to logging themselves with |
That's also true. There is possibility to log directly to terminal form libmpv with |
With that, I can only receive log messages, but I want to write log messages. |
If I understand you correctly, you mean that clients should capture the log messages, and then output/write those to wherever they want, and while at it, also insert their own messages in between as much as they like? If yes, then I think it's not what OP requested. The use case here, I'd imagine, is that the mpv logging backend is used normally, for instance logging to the console or to a file, and the libmpv client wants to add log messages which clearly came from that client and not from other sources in mpv, but there's no api available to them other than running a script and then using I think it's reasonable to expect that libmpv should have logging api. |
Correct. The same callback-based logging mechanism is also used by some mpv dependencies like libass. mpv captures the logs from these libraries and displays them on its own. I'm showing that this feature request isn't strictly necessary for this reason. That said, scripts already have access to the logging API, so I think this feature request is reasonable. |
Previously I ran an experiment to see if IINA could use one combined log file. I experimented with IINA capturing all mpv log messages with This is not the only log related issue for clients. See issue #12250. Every once in a while the mpv log file ends up containing a large block of NUL characters. |
I don't know the current status. Been quite a while since I ran that experiment. Possibly that was with mpv 0.35.1. PR #13363 was merged in January. The documentation for
Events are critical to the operation of the client. Bad client behavior happens if an event is dropped. I decided it was unwise to risk overflowing the event queue just to combine log files and did not look further into this. The problem with blocks of NUL characters in the mpv log file is very rare. I had to develop a stress test to reproduce it. It was on my mind as I recently found NUL characters in a log file again. I'd have to try reproducing it against |
Expected behavior of the wanted feature
Allow frontends/GUIs to write log messages, support a new input command with three parameters:
This way errors from mpv.net and mpv.net extensions can be seen directly in the on-screen console, no need to have a terminal attached.
Alternative behavior of the wanted feature
No response
Log File
No response
Sample Files
No response
The text was updated successfully, but these errors were encountered: